FreesearchR/man/remove_empty_attr.Rd

31 lines
598 B
Text
Raw Permalink Normal View History

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
\name{remove_empty_attr}
\alias{remove_empty_attr}
\title{Remove empty/NA attributes}
\usage{
remove_empty_attr(data)
}
\arguments{
\item{data}{data}
}
\value{
data of same class as input
}
\description{
Remove empty/NA attributes
}
\examples{
2025-04-22 13:57:59 +02:00
ds <- mtcars |>
lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label")) |>
dplyr::bind_cols()
ds |>
remove_empty_attr() |>
str()
2025-04-22 13:57:59 +02:00
mtcars |>
lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label")) |>
remove_empty_attr() |>
str()
}