labelled
This package is built on the new classes haven_labelled and
haven_labelled_spss introduced by haven package to handle labelled
variables imported from SPSS, Stata and SAS. The labelled package
propose several functions to manipulate such vectors and their metadata:
variable labels, value labels and user-defined missing values.
Installation
From CRAN:
install.packages("labelled")Latest version from GitHub:
devtools::install_github("larmarange/labelled")Introduction to labelled
Read the vignette at http://larmarange.github.io/labelled/articles/intro_labelled.html
Breaking changes introduced in version 2.0.0
Following version 2.0.0 of haven, labelled() and labelled_spss()
now produce objects with class “haven_labelled” and
“haven_labelled_spss”, due to conflict between the previous
“labelled” class and the “labelled” class used by Hmisc.
A new function update_labelled() could be used to convert data
imported with an older version of haven to the new classes.
Some general principles
- Functions are intented to support
labelledmetadata structures only. However,to_labelledmethod allows to convert metadata from foreign and memisc packages. - Functions should, by default, modify metadata only (i.e. classes and attributes), except if explicitly expressed by the user.