changeValLabels: Change value labels.

View source: R/changeValLabels.R

changeValLabelsR Documentation

Change value labels.

Description

Change or add value labels of a variable as part of a GADSdat or all_GADSdat object.

Usage

changeValLabels(GADSdat, varName, value, valLabel)

Arguments

GADSdat

GADSdat object imported via eatGADS.

varName

Character string of a variable name.

value

Numeric values.

valLabel

Character string of the new value labels.

Details

Applied to a GADSdat or all_GADSdat object, this function is a wrapper of getChangeMeta and applyChangeMeta.

Value

Returns the GADSdat object with changed meta data.

Examples

# Change existing value labels
pisa2 <- changeValLabels(pisa, varName = "repeated",
                        value = c(1, 2),
                        valLabel = c("no grade repetition", "grade repitition"))

# Add value label to unlabeled value
mtcars_g <- import_DF(mtcars)
mtcars_g2 <- changeValLabels(mtcars_g, varName = "cyl",
                             value = c(4, 6, 8),
                             valLabel = c("four", "six", "eight"))


eatGADS documentation built on Oct. 9, 2024, 5:09 p.m.