assimilateValLabels {eatGADS} | R Documentation |
Assimilate value labels.
Description
Assimilate all value labels of multiple variables as part of a GADSdat
or all_GADSdat
object.
Usage
assimilateValLabels(GADSdat, varNames, lookup = NULL)
Arguments
GADSdat |
|
varNames |
Character string of a variable name. |
lookup |
Look up |
Details
Assimilation can be performed using all existing value labels or a look up table containing at least all existing value labels.
Missing codes are reused based on the meta data of the first variable in varNames
.
Value
Returns the GADSdat
object with changed meta data and recoded values.
Examples
# Example data set
facs_df <- data.frame(id = 1:3, fac1 = c("Eng", "Aus", "Ger"),
fac2 = c("Ger", "Franz", "Ita"),
fac3 = c("Kor", "Chi", "Alg"),
stringsAsFactors = TRUE)
facs_gads <- import_DF(facs_df)
assimilateValLabels(facs_gads, varNames = paste0("fac", 1:3))
[Package eatGADS version 1.1.0 Index]