Converts referendum data variable names to their ready-for-publication version. Variable names that are unknown, i.e. not present in data_codebook
), are
left untouched.
Arguments
- var_names
Variable name(s). Those not present in
data_codebook
remain untouched. A character vector.
See also
Other referendum metadata functions:
data_codebook
,
val_lbls()
,
val_scale()
,
var_name_unnested()
,
var_vals()
Other functions to prettify names:
prettify_col_names()
Examples
rdb::prettify_var_names("topics_tier_1")
#> [1] "Top-tier political topics"
# also supports unnested var names
rdb::prettify_var_names("topic_tier_1")
#> [1] "Top-tier political topic"
# unknown var names are left untouched
rdb::prettify_var_names(var_names = c("topic_tier_1", "topic_tier_99"))
#> [1] "Top-tier political topic" "topic_tier_99"