https://github.com/cran/Hmisc
Raw File
Tip revision: 462397b7fd57a4cb3bf0b37c0fcceb0b208299b8 authored by Charles Dupont on 02 May 2007, 00:00:00 UTC
version 3.4-2
Tip revision: 462397b
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