https://github.com/cran/Hmisc
Raw File
Tip revision: ffaa7df0d13fef0eb7566405cc8d47eb60866db7 authored by Charles Dupont on 22 January 2009, 21:58:09 UTC
version 3.5-0
Tip revision: ffaa7df
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