https://github.com/cran/Hmisc
Raw File
Tip revision: 71f96275a1660d09b05b8069eae3493f01408e68 authored by Charles Dupont on 03 November 2008, 19:14:32 UTC
version 3.4-4
Tip revision: 71f9627
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