labs_replace | R Documentation |
Replace item value names in a column by their labels
labs_replace(
data,
col,
codes,
col_from = "value_name",
col_to = "value_label",
na.missing = FALSE
)
data |
A tibble. |
col |
The column holding item values. |
codes |
The codebook to use: A tibble with the columns
value_name and value_label.
Can be created by the codebook function, e.g. by calling
|
col_from |
The tidyselect column with source values, defaults to value_name. If the column is not found in the codebook, the first column is used. |
col_to |
The tidyselect column with target values, defaults to value_label. If the column is not found in the codebook, the second column is used |
na.missing |
By default, the column is converted to a factor with levels combined from the codebook and the data. Set na.missing to TRUE to set all levels not found in the codes to NA. |
Tibble with new labels.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.