#' status factor levels
#'
#' @description This function recodes factor levels in status vector
#' @param df The name of the dataframe you want to manipulate
#' @return datatframe, tibble
#' @keywords status levels
#' @import dplyr, stringr
#' @export
#' @examples tidyStatus(df = df)
tidyStatus <- function(df) {
df <- df %>%
dplyr::mutate(status = dplyr::case_when(status == 'UNTERSCHRIEBEN_PRODUKTANBIETER' ~ 'UNTERSCHRIEBEN_BEIDE',
status == 'UNTERSCHRIEBEN_ANTRAGSTELLER' ~ 'UNTERSCHRIEBEN_AS',
TRUE ~ status),
status = stringr::str_remove_all(status, pattern = '_PRODUKTANBIETER'),
status = stringr::str_remove_all(status, pattern = '_ANTRAGSTELLER'))
return(df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.