rename_cat_variables | R Documentation |
Renaming categorical variables and their levels, for instance for summary tables, can be fiddly. This function accepts tibbles containing the old and new names for arguments and levels, and returns a dataframe (or list of dataframes, if one is passed) with variables and levels renamed.
rename_cat_variables(data, var_names = NULL, level_names = NULL)
data |
A dataframe or list of dataframes (e.g., from multiple imputation) contains the variables. If a list is passed, it must have class "list" |
var_names |
A tibble containing |
level_names |
A tibble containing old |
The dataframe or list of dataframes passed to data, with variables and/or levels renamed. Any variables where levels are renamed will be converted to factors.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.