View source: R/assimilateValLabels.R
assimilateValLabels | R Documentation |
Assimilate all value labels of multiple variables as part of a GADSdat
or all_GADSdat
object.
assimilateValLabels(GADSdat, varNames, lookup = NULL)
GADSdat |
|
varNames |
Character string of a variable name. |
lookup |
Look up |
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
.
Returns the GADSdat
object with changed meta data and recoded values.
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.