https://github.com/cran/Hmisc
Raw File
Tip revision: 60e35752daed1915656000bebb27bf583bf1dd70 authored by Frank E Harrell Jr on 08 December 2016, 12:57:59 UTC
version 4.0-1
Tip revision: 60e3575
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