2025-04-11 13:23:18 +02:00
|
|
|
% 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
|
|
|
|
}
|
2025-04-15 12:04:32 +02:00
|
|
|
\examples{
|
2025-04-22 13:57:59 +02:00
|
|
|
ds <- mtcars |>
|
|
|
|
lapply(\(.x) REDCapCAST::set_attr(.x, label = NA, attr = "label")) |>
|
|
|
|
dplyr::bind_cols()
|
2025-04-15 12:04:32 +02:00
|
|
|
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() |>
|
2025-04-15 12:04:32 +02:00
|
|
|
str()
|
|
|
|
|
|
|
|
}
|