https://github.com/cran/Hmisc
Raw File
Tip revision: e2b83144bb94f493b29a63bc48fb3d21577418a2 authored by Charles Dupont on 26 January 2009, 16:38:03 UTC
version 3.5-2
Tip revision: e2b8314
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