Marks one or more variables as select-all-that-apply (SATA) in a survey
design object or a data frame. Unlike the other unified setters (which map
variable names to heterogeneous content), set_sata() applies a single
logical flag to all listed variables, so it uses a simplified two-convention
pattern.
Arguments
- x
A survey design object or
data.frame.- ...
<
tidy-select> Variables to mark. Supports selection helpers:tidyselect::starts_with(),tidyselect::all_of(),tidyselect::any_of(), etc. Cannot be combined withvariable.- variable
character. Alternative programmatic interface: character vector of variable names. Cannot be combined with....- sata
logical(1).TRUE(default) marks variables as SATA;FALSEremoves the SATA flag.NAis not accepted.
Details
Convention A (tidy-select ...) — recommended:
Convention B (variable = character vector) — programmatic:
Setting sata = FALSE unmarks the listed variables.
See also
extract_sata() to retrieve SATA flags
Other metadata:
classify_question_type(),
extract_metadata(),
extract_missing_codes(),
extract_question_preface(),
extract_sata(),
extract_universe(),
extract_val_labels(),
extract_var_label(),
extract_var_note(),
infer_question_prefaces(),
set_missing_codes(),
set_question_preface(),
set_universe(),
set_val_labels(),
set_var_label(),
set_var_note(),
survey_metadata(),
survey_weighting_history()
Examples
d <- as_survey(nhanes_2017, ids = sdmvpsu, weights = wtint2yr,
strata = sdmvstra, nest = TRUE)
d <- set_sata(d, riagendr, ridageyr)
d <- set_sata(d, riagendr, sata = FALSE)
