https://github.com/cran/Hmisc
Raw File
Tip revision: 30f3c1bed7ca77b69ddb3e361b110f264a68f71f authored by Charles Dupont on 02 October 2006, 18:31:50 UTC
version 3.1-1
Tip revision: 30f3c1b
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