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

30,911

Version

1.1.7

License

GPL-3

Maintainer

Daniel Lüdecke

Last Published

September 24th, 2020

Functions in sjlabelled (1.1.7)

convert_case

Generic case conversion for labels
get_label

Retrieve variable label(s) of labelled data
get_labels

Retrieve value labels of labelled data
as_numeric

Convert factors to numeric variables
add_labels

Add, replace or remove value labels of variables
as_factor

Convert variable into factor and keep value labels
as_character

Convert variable into factor with associated value labels
efc

Sample dataset from the EUROFAMCARE project
copy_labels

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

Convert vector to labelled class
get_na

Retrieve tagged NA values of labelled variables
is_labelled

Check whether object is of class "labelled"
set_na

Replace specific values in vector with NA
sjlabelled-package

Labelled Data Utility Functions
term_labels

Retrieve labels of model terms from regression models
label_to_colnames

Use variable labels as column names
set_labels

Add value labels to variables
unlabel

Convert labelled vectors into normal classes
read_spss

Import data from other statistical software packages
tidy_labels

Repair value labels
remove_all_labels

Remove value and variable labels from vector or data frame
get_values

Retrieve values of labelled variables
remove_label

Remove variable labels from variables
zap_na_tags

Convert tagged NA values into regular NA
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