val_lbls: Get set of possible _value labels_ of referendum data...

val_lblsR Documentation

Get set of possible value labels of referendum data variable

Description

Returns a character vector of value labels of a specific rfrnds() column, in the same order as var_vals(), or of length 0 if var_name's values are not restricted to a predefined set or no value labels are defined in the codebook.

Usage

val_lbls(var_name, incl_affixes = TRUE)

Arguments

var_name

Variable name present in data_codebook for which the labels are to be returned. A character scalar.

incl_affixes

Whether or not to add the corresponding value_label_prefix and value_label_suffix to the returned labels.

Value

A character vector. Of length 0 if var_name's values are not restricted to a predefined set or no value labels are defined in the codebook.

See Also

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

Examples

rdb::val_lbls("result",
              incl_affixes = FALSE)
rdb::val_lbls("result")

# Convert the labels to sentence case with trailing dot
rdb::val_lbls("result") |> pal::sentenceify()

zdaarau/c2d documentation built on Dec. 18, 2024, 1:24 p.m.