Skip to contents

Sets value labels for multiple variables at once using named arguments. Each argument value must be a fully named vector. A warning is issued for any variable where some observed values lack a label.

Usage

set_value_labels(x, ...)

Arguments

x

A survey design object.

...

Named arguments where the name is the variable (unquoted) and the value is a named vector of value labels.

Value

The modified survey object, invisibly.

Examples

d <- as_survey(nhanes_2017, ids = sdmvpsu, weights = wtint2yr,
               strata = sdmvstra, nest = TRUE)
d <- set_value_labels(
  d,
  riagendr = c(Male = 1L, Female = 2L),
  ridstatr = c("Interview only" = 1L, "Interview + exam" = 2L)
)