FreesearchR/man/remove_empty_attr.Rd
Andreas Gammelgaard Damsbo 2249ba06db
Some checks are pending
pkgdown.yaml / pkgdown (push) Waiting to run
more docs
2025-04-22 13:57:59 +02:00

30 lines
598 B
R

% 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()
}