This function takes a single column of data and converts the values based on the overall data tibble cross referenced with a nested section of the metadata tibble.
case_when
logic helps determine whether the value is a coalesced singular
value or a user-specified one via multi_value_label
or values_fill
.
If multi_value_label
is NULL
, multiple checkbox selections are pasted
together using multi_value_sep
specification.
convert_checkbox_vals(
metadata,
.new_value,
data_tbl,
raw_or_label,
multi_value_label,
values_fill,
multi_value_sep
)
A nested portion of the overall metadata tibble
The new column values made by combine_checkboxes()
The data tibble from the original supertibble
Either 'raw' or 'label' to specify whether to use raw coded values or labels for the options. Default 'label'.
A string specifying the value to be used when multiple
checkbox fields are selected. Default "Multiple". If NULL
, multiple
selections will be pasted together using multi_value_sep
specification.
Value to use when no checkboxes are selected. Default NA
.
A string specifying the separator to use to paste
multiple selections together when multi_value_label
is NULL
. Default
", "
.
This function is used in conjunction with pmap()
.