createLabelList: Creates a data.frame with variable and value labels from...

createLabelListR Documentation

Creates a data.frame with variable and value labels from variable attributes

Description

By default, read.spss from the foreign package uses variable.labels as attributes of the whole data.frame, value.labels as attribute of each specific variable in the data.frame. convertLabel provides variable and value labels as variable attributes. createLabelList creates a data.frame with variable and value labels.

Usage

createLabelList(dfr, additionalAttributes = NULL)

Arguments

dfr

A data.frame with variable and value labels stored as attributes using the convention of convertLabel.

additionalAttributes

Optional: Vector of names of additional attributes which should be collected in the returned data frame.

Value

A data.frame.

Author(s)

Sebastian Weirich

Examples

file <- system.file("extdata", "Klauer.sav", package = "eatAnalysis")
dat  <- foreign::read.spss(file, to.data.frame=FALSE, use.value.labels = FALSE)
dat  <- convertLabel(dat)
atts <- createLabelList(dat)

beckerbenj/eatAnalysis documentation built on July 7, 2023, 5:51 p.m.