https://github.com/cran/Hmisc
Raw File
Tip revision: 7bf6f0715375f05bd433f09fbe712daabc91af6b authored by Charles Dupont on 01 May 2010, 15:58:22 UTC
version 3.7-0.1
Tip revision: 7bf6f07
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