Introduction

sjlabelled-package sjlabelled

Labelled Data Utility Functions

Variable Labels

get_label()

Retrieve variable label(s) of labelled data

copy_labels()

Copy value and variable labels to (subsetted) data frames

label_to_colnames()

Use variable labels as column names

remove_label()

Remove variable labels from variables

remove_all_labels()

Remove value and variable labels from vector or data frame

set_label() `set_label<-`() var_labels()

Add variable label(s) to variables

Value Labels

add_labels() replace_labels() remove_labels()

Add, replace or remove value labels of variables

copy_labels()

Copy value and variable labels to (subsetted) data frames

get_labels()

Retrieve value labels of labelled data

remove_all_labels()

Remove value and variable labels from vector or data frame

set_labels() val_labels()

Add value labels to variables

Labelled Model Predictors

term_labels() get_term_labels() response_labels() get_dv_labels()

Retrieve labels of model terms from regression models

Labelled Values

get_values()

Retrieve values of labelled variables

tidy_labels()

Repair value labels

Missing Values

get_na()

Retrieve tagged NA values of labelled variables

set_na()

Replace specific values in vector with NA

Converting Variables

as_character() to_character() as_label() to_label()

Convert variable into factor with associated value labels

as_factor() to_factor()

Convert variable into factor and keep value labels

as_numeric() to_numeric()

Convert factors to numeric variables

Converting Labelled Variables

as_labelled()

Convert vector to labelled class

convert_case()

Generic case conversion for labels

is_labelled()

Check whether object is of class "labelled"

unlabel()

Convert labelled vectors into normal classes

drop_labels() fill_labels() zap_labels() zap_unlabelled()

Drop, add or convert (non-)labelled values

zap_na_tags()

Convert tagged NA values into regular NA

Importing and Exporting Data

read_spss() read_sas() read_stata() read_data()

Import data from other statistical software packages

write_spss() write_stata() write_sas()

Write data to other statistical software packages

Sample Data

efc

Sample dataset from the EUROFAMCARE project