View source: R/codebook_preproc.R
codebook_recoder | R Documentation |
Recode the values of multiple columns .
codebook_recoder(df, var_regex, values_from, values_to, FUN = as.numeric)
df |
Dataframe of data to be recoded. |
var_regex |
Vector of regex patterns describing columns to recode values. |
values_from |
Vector of possible values to be recoded. |
values_to |
Vector of values to recode values_from into. |
FUN |
Function to to apply to column after recoding. Set to NULL if no function is desired. |
A dataframe with recoded values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.