Skip to contents

Returns a vector of the possible predefined values a specific column in rfrnds() can hold. If the variable values aren't restricted to a predefined set, NULL is returned.

Usage

var_vals(var_name)

Arguments

var_name

Variable name present in data_codebook. A character scalar.

Value

If var_name's values are restricted to a predefined set and

  • var_name is not of type list, a vector of the same type as var_name.

  • var_name is of type list, a vector of the same type as the elements of var_name.

Else NULL.

See also

Other referendum metadata functions: data_codebook, prettify_var_names(), val_lbls(), val_scale(), var_name_unnested()

Examples

rdb::var_vals("result")
#> [1] "yes" "no" 
rdb::var_vals("id")
#> character(0)