https://github.com/cran/Hmisc
Raw File
Tip revision: 97a8e402ce27502269a0c403a337e874970a1cef authored by Charles Dupont on 03 May 2013, 15:15:14 UTC
version 3.10-1.1
Tip revision: 97a8e40
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