Returns analyst notes for one or more variables in a survey design object or data frame.
Arguments
- x
A survey design object or
data.frame.- ...
<
data-masked> Variable names (bare, unquoted). If empty, metadata for all variables is returned.- format
character(1). Output format:"named_vector"(default),"list", or"data_frame".- fill
Scalar or
NULL. How to handle variables with no note:NULL(default) omits them;NA_character_includes them withNA.
Value
"named_vector"(default): named character vector. Empty:character(0)."list": named list of character scalars. Empty:list()."data_frame": tibble with columnsvariableandnote. Empty: zero-row tibble.
See also
set_var_note() to set a note
Other metadata:
extract_metadata(),
extract_missing_codes(),
extract_question_preface(),
extract_universe(),
extract_val_labels(),
extract_var_label(),
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(gss_2024, ids = vpsu, weights = wtssps,
strata = vstrat, nest = TRUE)
d <- set_var_note(d, age = "Top-coded at 89")
extract_var_note(d, age)
#> age
#> "Top-coded at 89"
