https://github.com/cran/Hmisc
Raw File
Tip revision: 0b4bebaca73884db38359dde253a0944cdf08f80 authored by Frank E Harrell Jr on 07 February 2020, 14:50:02 UTC
version 4.3-1
Tip revision: 0b4beba
data.frame.labelled.s
## For every object in a data frame that has a 'label' attribute, make it
## class 'labelled'

data.frame.labelled <- function(object)
{
  for(n in names(object))
    if(length(attr(object[[n]],'label')))
      attr(object[[n]],'class') <- c('labelled',attr(object[[n]],'class'))

  object
}
back to top