Skip to contents

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)

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.

Value

The modified object, invisibly.

Details

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

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"