# Examples below show the same codelist in both regular and wide format
dta <- data.frame(codes = c(1:3, 1:3),
labels = c(letters[1:3], LETTERS[1:3]),
locale = c("en", "en", "en", "nl" ,"nl" ,"nl"))
as.codelist(dta, format = "regular")
dta <- data.frame(codes = 1:3, labels_en = letters[1:3],
labels_nl = LETTERS[1:3])
as.codelist(dta, format = "wide")
Run the code above in your browser using DataLab