https://github.com/cran/Hmisc
Raw File
Tip revision: 756202ad5070d5ebcadc19712ed6f7f983d4e990 authored by Frank E Harrell Jr on 31 December 2016, 08:59:06 UTC
version 4.0-2
Tip revision: 756202a
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