https://github.com/cran/Hmisc
Raw File
Tip revision: 267f8b12991f584d7550e026a7d65362a7bd114e authored by Charles Dupont on 05 May 2010, 08:08:01 UTC
version 3.8-0
Tip revision: 267f8b1
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