Use lookup table to replace values in a data frame
1 2 | use_lookup(.data, lookup, mark = c("old", "new", "both"),
use_na = FALSE, drop_old = TRUE)
|
.data |
a data frame |
lookup |
a lookup table, or a path pointing to a file containing such |
mark |
mark which column name in the resulting data frame? choose from: "old", "new" or "both" |
use_na |
use NAs in 'new_value' for replacement; if FALSE, use 'old_value' as 'new_value' |
drop_old |
keep only the new column after recoding |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.