https://github.com/cran/Hmisc
Raw File
Tip revision: 44407c758dfbd73d6000c7e282bfa374ee49b5fe authored by Charles Dupont on 12 February 2007, 18:05:39 UTC
version 3.2-1
Tip revision: 44407c7
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