https://github.com/cran/Hmisc
Raw File
Tip revision: 256ea0f4576fef9b8641bd64e4d800ac668b805f authored by Frank E Harrell Jr on 29 November 2020, 05:00:16 UTC
version 4.4-2
Tip revision: 256ea0f
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