ct_mappings()
takes a controlled terminology specification and returns the
mappings in the form of a tibble in long format,
i.e. the recoding of values in the from
column to the to
column values,
one mapping per row.
The resulting mappings are unique, i.e. if from
values are duplicated in
two from
columns, the first column indicated in from
takes precedence,
and only that mapping is retained in the controlled terminology map.
ct_mappings(ct_spec, from = ct_spec_vars("from"), to = ct_spec_vars("to"))
A tibble with two columns, from
and
to
, indicating the mapping of values, one per row.
Controlled terminology specification as a
tibble. Each row is for a mapped controlled term.
Controlled terms are expected in the column indicated by to_col
.
A character vector of column names indicating the variables containing values to be recoded.
A single string indicating the column whose values are to be recoded into.