Learn R Programming

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

sjlabelled - Labelled Data Utility Functions

        

This package contains utility functions that are useful when working with labelled data (especially intended for people coming from 'SPSS', 'SAS' or 'Stata' and/or who are new to R).

Basically, this package covers reading and writing data between other statistical packages (like 'SPSS') and R, based on the haven and foreign packages; hence, this package also includes functions to make working with labelled data easier. This includes easy ways to get, set or change value and variable label attributes, to convert labelled vectors into factors or numeric (and vice versa), or to deal with multiple declared missing values.

Installation

Latest development build

To install the latest development snapshot (see latest changes below), type following commands into the R console:

library(devtools)
devtools::install_github("strengejacke/sjlabelled")

Officiale, stable release

To install the latest stable release from CRAN, type following command into the R console:

install.packages("sjlabelled")

Citation

In case you want / have to cite my package, please use citation('sjlabelled') for citation information.

Copy Link

Version

Install

install.packages('sjlabelled')

Monthly Downloads

40,204

Version

1.1.3

License

GPL-3

Maintainer

Daniel Lüdecke

Last Published

January 28th, 2020

Functions in sjlabelled (1.1.3)

convert_case

Generic case conversion for labels
efc

Sample dataset from the EUROFAMCARE project
as_factor

Convert variable into factor and keep value labels
as_labelled

Convert vector to labelled class
as_numeric

Convert factors to numeric variables
as_character

Convert variable into factor with associated value labels
copy_labels

Copy value and variable labels to (subsetted) data frames
add_labels

Add, replace or remove value labels of variables
get_label

Retrieve variable label(s) of labelled data
get_labels

Retrieve value labels of labelled data
set_labels

Add value labels to variables
get_values

Retrieve values of labelled variables
sjlabelled-package

Labelled Data Utility Functions
get_na

Retrieve tagged NA values of labelled variables
unlabel

Convert labelled vectors into normal classes
tidy_labels

Repair value labels
set_na

Replace specific values in vector with NA
remove_all_labels

Remove value and variable labels from vector or data frame
read_spss

Import data from other statistical software packages
label_to_colnames

Use variable labels as column names
zap_na_tags

Convert tagged NA values into regular NA
is_labelled

Check whether object is of class "labelled"
remove_label

Remove variable labels from variables
set_label

Add variable label(s) to variables
write_spss

Write data to other statistical software packages
drop_labels

Drop, add or convert (non-)labelled values
term_labels

Retrieve labels of model terms from regression models