implement support for variable attributes for field label incl conversion of logicals to factor

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-11-19 12:54:26 +01:00
commit fe9918dc10
No known key found for this signature in database
6 changed files with 132 additions and 11 deletions

27
man/get_attr.Rd Normal file
View file

@ -0,0 +1,27 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ds2dd_detailed.R
\name{get_attr}
\alias{get_attr}
\title{Extract attribute. Returns NA if none}
\usage{
get_attr(data, attr = NULL)
}
\arguments{
\item{data}{vector}
\item{attr}{attribute name}
}
\value{
character vector
}
\description{
Extract attribute. Returns NA if none
}
\examples{
attr(mtcars$mpg, "label") <- "testing"
sapply(mtcars, get_attr)
lapply(mtcars, \(.x)get_attr(.x, NULL))
mtcars |>
numchar2fct(numeric.threshold = 6) |>
ds2dd_detailed()
}