#' profession factor levels
#'
#' @description This function recodes factor levels in profession vector
#' @param df The name of the dataframe you want to manipulate
#' @return datatframe, tibble
#' @keywords profession levels
#' @import dplyr, forcats
#' @export
#' @examples tidyProfession(df = df)
tidyProfession <- function(df) {
df <- df %>%
dplyr::mutate(antragsteller1beschaeftigungsart = forcats::fct_recode(antragsteller1beschaeftigungsart,
'SELBSTSTAENDIGER' = 'GF_GESELLSCHAFTER',
'SELBSTSTAENDIGER' = 'FREIBERUFLER',
'SELBSTSTAENDIGER' = 'SELBSTAENDIGER'),
antragsteller2beschaeftigungsart = forcats::fct_recode(antragsteller2beschaeftigungsart,
'SELBSTSTAENDIGER' = 'GF_GESELLSCHAFTER',
'SELBSTSTAENDIGER' = 'FREIBERUFLER',
'SELBSTSTAENDIGER' = 'SELBSTAENDIGER'),
antragsteller1beschaeftigungsart = forcats::fct_relevel(antragsteller1beschaeftigungsart,c("ANGESTELLTER","ARBEITER", "BEAMTER", "SELBSTSTAENDIGER", "HAUSFRAU", "RENTNER", "ARBEITSLOSER")),
antragsteller2beschaeftigungsart = forcats::fct_relevel(antragsteller2beschaeftigungsart,c("ANGESTELLTER","ARBEITER", "BEAMTER", "SELBSTSTAENDIGER", "HAUSFRAU", "RENTNER", "ARBEITSLOSER"))
)
return(df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.