FreesearchR/man/remove_empty_attr.Rd

27 lines
591 B
Text
Raw 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{
ds <- mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label")) |> dplyr::bind_cols()
ds |>
remove_empty_attr() |>
str()
mtcars |> lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label")) |> remove_empty_attr() |>
str()
}