powered by
Sets the universe description for one or more variables. The universe describes the population to which a variable applies (e.g., "Adults 18+").
"Adults 18+"
set_universe(x, ..., variable = NULL, universe = NULL)
The modified object, invisibly.
A survey design object or a data frame.
Named arguments where the name is the variable and the value is the universe description string. Supports !!! list splicing.
!!!
A character vector of variable names. Use with universe.
universe
A character vector of universe description strings, one per element of variable.
variable
Supports Conventions 1, 2, and 3 — see set_var_label() for details.
set_var_label()
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_sata(), set_val_labels(), set_var_label(), set_var_note(), survey_metadata(), survey_weighting_history()
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_sata()
set_val_labels()
set_var_note()
survey_metadata()
survey_weighting_history()
d <- as_survey(gss_2024, ids = vpsu, weights = wtssps, strata = vstrat, nest = TRUE) d <- set_universe(d, age = "All respondents 18+") extract_metadata(d, age)
Run the code above in your browser using DataLab