Learn R Programming

surveycore (version 0.8.3)

set_var_note: Set Analyst Note(s)

Description

Sets an analyst note for one or more variables. Notes are free-text annotations for documenting processing decisions, data quality concerns, or other context.

Usage

set_var_note(x, ..., variable = NULL, note = NULL)

Value

The modified object, invisibly.

Arguments

x

A survey design object or a data frame.

...

Named arguments where the name is the variable and the value is the note string. Supports !!! list splicing.

variable

A character vector of variable names. Use with note.

note

A character vector of note strings, one per element of variable.

Details

Supports Conventions 1, 2, and 3 — see set_var_label() for details.

See Also

extract_var_note() to retrieve a note

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_universe(), set_val_labels(), set_var_label(), survey_metadata(), survey_weighting_history()

Examples

Run this code
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)

Run the code above in your browser using DataLab