df_labelled_to_factor: Takes a data frame containing variables of class...

Description Usage Arguments Value Examples

View source: R/data.R

Description

Takes a data frame containing variables of class haven::labelled and replaces them with factors

Usage

1

Arguments

ldf

A data frame which may contained variables of class haven::labelled

Value

A data frame in which labeled variables have been replaced with factors

Examples

1
2
3
4
5
fp <- system.file("extdata", "survey_data.sav", package = "zmarket")
orig <- haven::read_sav(fp)
rep <- df_labelled_to_factor(orig)
lapply(orig, "class")
lapply(rep, "class")

e3bo/zmarket documentation built on Dec. 20, 2021, 2:21 a.m.