Learn R Programming

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,112

Version

1.2.0

License

GPL-3

Maintainer

Last Published

April 10th, 2022

Functions in sjlabelled (1.2.0)

as_labelled

Convert vector to labelled class
as_numeric

Convert factors to numeric variables
copy_labels

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

Add, replace or remove value labels of variables
as_character

Convert variable into factor with associated value labels
get_label

Retrieve variable label(s) of labelled data
convert_case

Generic case conversion for labels
get_labels

Retrieve value labels of labelled data
is_labelled

Check whether object is of class "labelled"
remove_label

Remove variable labels from variables
read_spss

Import data from other statistical software packages
set_label

Add variable label(s) to variables
zap_na_tags

Convert tagged NA values into regular NA
remove_all_labels

Remove value and variable labels from vector or data frame
get_na

Retrieve tagged NA values of labelled variables
write_spss

Write data to other statistical software packages
get_values

Retrieve values of labelled variables
drop_labels

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

Use variable labels as column names
set_labels

Add value labels to variables
tidy_labels

Repair value labels
set_na

Replace specific values in vector with NA
unlabel

Convert labelled vectors into normal classes
sjlabelled-package

Labelled Data Utility Functions
term_labels

Retrieve labels of model terms from regression models
as_factor

Convert variable into factor and keep value labels
efc

Sample dataset from the EUROFAMCARE project