vector_with_old_varnames_to_be_collapsed <- c("Var", "var", "Variable", "variables") df %>% mutate(collapsed_variables = fct_collapse(variables_column, Variable = vector_with_old_varnames_to_be_collapsed)))
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter