Learn R Programming

⚠️There's a newer version (2.14.0) of this package.Take me there.

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")

Development version from GitHub:

devtools::install_github("larmarange/labelled")

Introduction

Read the vignette at https://larmarange.github.io/labelled/articles/intro_labelled.html

Cheatsheet

Some general guidelines

  1. Functions are intended to support labelled metadata structures only. However, to_labelled() method allows to convert metadata from foreign and memisc packages.
  2. Functions should, by default, modify metadata only (i.e. classes and attributes), except if explicitly expressed by the user.

Copy Link

Version

Install

install.packages('labelled')

Monthly Downloads

62,265

Version

2.7.0

License

GPL-3

Maintainer

Joseph Larmarange

Last Published

September 21st, 2020

Functions in labelled (2.7.0)

names_prefixed_by_values

Turn a named vector into a vector of names prefixed by values
nolabel_to_na

Recode values with no label to NA
recode.haven_labelled

Recode values
to_labelled

Convert to labelled data
reexports

Objects exported from other packages
to_factor

Convert input to a factor.
sort_val_labels

Sort value labels
to_character

Convert input to a character vector
copy_labels

Copy variable and value labels and SPSS-style missing value
drop_unused_value_labels

Drop unused value labels
val_labels_to_na

Recode value labels to NA
var_label

Get / Set a variable label
remove_attributes

Remove attributes
remove_labels

Remove variable label, value labels and user defined missing values
look_for

Look for keywords variable names and descriptions / Create a data dictionary
na_values

Get / Set SPSS missing values
update_labelled

Update labelled data to last version
val_labels

Get / Set value labels