https://github.com/cran/Hmisc
Raw File
Tip revision: 7728929d8f2cbde7acc6d245955a99eb5809e357 authored by Frank E Harrell Jr on 12 September 2014, 15:50:33 UTC
version 3.14-5
Tip revision: 7728929
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