recode_column_values | R Documentation |
Recode Column Values This function will recode a column of values in a tibble based o the list passed. If no list is passed none of the values will be replaces unless optional arguments are passed via ... to dplyr::recode such as .default or .missing
recode_column_values(tbl, column, lst = NULL, ...)
tbl |
A tibble data <- dplyr::tribble( ~col1, ~col2, "a", "c", "a", "d", "b", NA ) |
column |
A string that is the name of a column in the tbl that will be recoded |
lst |
A named list where each name is a possible value in the column, and the values are their replacements lst <- list("a" = "x", "b" = "y", "c" = "z") |
... |
Other arguments to dplyr::recode |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.