Join decode labels or levels
Usage
join_decode_labels(.data, decode_tbls, lvl_to_lbl = "{var}C", ...)
join_decode_levels(.data, decode_tbls, lvl_to_lbl = "{var}C", ...)
decode_tbls_lvl_to_lbl(decode_tbls, lvl_to_lbl = "{var}C")
Arguments
- .data
data frame
- decode_tbls
decode_tbls
list as returned byextract_decode_tbls()
orextract_decode_tbls_from_data()
. Alternatively, the result ofread_requirements()
can be used directly.- lvl_to_lbl
a named
list
, where elements correspond to matching names in.data
anddecode_tbls
. One element can be left unnamed to provide the default transformation. Each element should be either: (1) a function/formula; (2) a custom glue specification. The default is"{var}C"
, which means the label variable name is the level variable name appended with a "C".- ...
additional arguments (currently unused)
Value
data frame with the same number of rows as .data
. New
variables will be included for matching content in .data
and
decode_tbls
.
See also
extract_decode_tbls_from_data
to extract decode tables from a
dataset;
extract_decode_tbls
to extract decode tables from a table
describing variable decodes.