https://github.com/cran/Hmisc
Raw File
Tip revision: cd1e1fd18594f7d47a013bedc64855601390b9b5 authored by Frank E Harrell Jr on 07 October 2021, 08:00:02 UTC
version 4.6-0
Tip revision: cd1e1fd
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