changeValLabels {eatGADS} | R 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 |
|
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"))
[Package eatGADS version 1.1.0 Index]