#' purpose factor levels
#'
#' @description This function recodes factor levels in purpose vector
#' @param df The name of the dataframe you want to manipulate
#' @return datatframe, tibble
#' @keywords purpose levels
#' @import dplyr, forcats
#' @export
#' @examples fun_tidyPurpose(df = df)
tidyPurpose <- function(df) {
df <- df %>%
dplyr::mutate(verwendungszweck = forcats::fct_recode(verwendungszweck,
'Fahrzeug' = 'Fahrzeugkauf'),
verwendungszweck = forcats::fct_relevel(verwendungszweck, c("Sonstiges","Fahrzeug", "Umschuldung", "Wohnen")))
return(df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.