Sets variable labels for multiple variables at once using named arguments. All variable names must exist in the survey data.
See also
set_var_label() for setting a single label
Other metadata:
extract_question_preface(),
extract_val_labels(),
extract_var_label(),
extract_var_note(),
infer_question_prefaces(),
set_question_preface(),
set_question_prefaces(),
set_val_labels(),
set_value_labels(),
set_var_label(),
set_var_note(),
set_variable_notes(),
survey_metadata(),
survey_weighting_history()
Examples
d <- as_survey(nhanes_2017, ids = sdmvpsu, weights = wtint2yr,
strata = sdmvstra, nest = TRUE)
d <- set_variable_labels(
d,
bpxsy1 = "Systolic BP, 1st reading (mm Hg)",
bpxdi1 = "Diastolic BP, 1st reading (mm Hg)"
)
# Programmatic with list splicing
lbls <- list(bpxsy1 = "Systolic BP", bpxdi1 = "Diastolic BP")
d <- set_variable_labels(d, !!!lbls)