# Prepare example data
mt2 <- data.frame(ID = 1:4, mc1 = c(1, 0, 0, 0), mc2 = c(0, 0, 0, 0), mc3 = c(0, 1, 1, 0),
text1 = c(NA, "Eng", "Aus", "Aus2"), text2 = c(NA, "Franz", NA, NA),
stringsAsFactors = FALSE)
mt2_gads <- import_DF(mt2)
mt3_gads <- changeVarLabels(mt2_gads, varName = c("mc1", "mc2", "mc3"),
varLabel = c("Lang: Eng", "Aus spoken", "other"))
out <- matchValues_varLabels(mt3_gads, mc_vars = c("mc1", "mc2", "mc3"),
values = c("Aus", "Eng", "Eng"),
label_by_hand = c("other" = "mc3"))
Run the code above in your browser using DataLab