recode | R Documentation |
This function recode labelled columns
recode( df, var, newvar = var, newvar_label = NULL, missing = NULL, recode, sep = " / " )
df |
a data frame |
var |
a string with the name of the variable in the data frame to be recoded |
newvar |
a string with the name of the new variable that will receive the recoded columns. By default, it uses the original variable (var) |
newvar_label |
string with the label for the new variable |
recode |
a named vector. The names are the code of the labels in the old variable. The values are the new values |
sep |
a string to use to separate labels when joining values during the recoding |
It returns a tibble data frame with recoded column
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.