Learn R Programming

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

Labelled package for R

This package is built on the new class labelled introduced by haven package and propose additional functions to manipulate labelled data.

Please note that this package is still under active development.

Missing values are currently not supported anymore by labelled package.

Installation

From CRAN:

install.packages("labelled")

Latest version from GitHub:

devtools::install_github("larmarange/labelled")

Introduction to labelled

Read https://github.com/larmarange/labelled/blob/master/vignettes/intro_labelled.Rmd

Some general principles

  1. Functions are intented 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

1.0.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Joseph Larmarange

Last Published

November 20th, 2016

Functions in labelled (1.0.0)

as.data.frame.labelled

as.data.frame method for labelled vectors
copy_labels

Copy variable and value labels
val_labels_to_na

Recode value labels to NA
val_labels

Get / Set value labels
mean.labelled

Arithmetic mean for numeric labelled vectors
na_values

Get / Set SPSS missing values
nolabel_to_na

Recode values with no label to NA
remove_labels

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

Convert input to a factor.
to_labelled

Convert to labelled data
labelled_spss

Create a labelled vector with SPSS style of missing values.
labelled

Create a labelled vector.
var_label

Get / Set a variable label
to_character

Convert input to a character vector
sort_val_labels

Sort value labels