https://github.com/cran/Hmisc
Raw File
Tip revision: 18ebfb8abe3d9e36acb857ccb1d6b7c57a43b145 authored by Charles Dupont on 29 April 2009, 17:54:42 UTC
version 3.6-0
Tip revision: 18ebfb8
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