# make a "Likert"-type fake data set to demo
# note, by default, add_val_labs() "vars" arg will do partial matching
# in this case, we catch all vars with "x" in their name
set.seed(272)
dflik <- make_likert_data(scale = 1:7)
vals2label <- 1:7
labs2use <- c(
"VSD",
"SD",
"D",
"N",
"A",
"SA",
"VSA"
)
dflik <- add_val1(
data = dflik, var = x3,
vals = vals2label,
labs = labs2use
)
# see what this did
get_val_labs(dflik, "x3")
dfdrop <- drop_val1(dflik,
var = x3
) # odd choice, but ok
# var x3's value labels are gone, like we asked for
get_val_labs(dfdrop, "x3")
Run the code above in your browser using DataLab