#' age
#'
#' @description This function calculates the age of each applicant
#' @param df The name of the dataframe you want to manipulate
#' @return datatframe, tibble
#' @keywords age
#' @import dplyr
#' @export
#' @examples tidy.age(df = df)
tidy.age <- function(df) {
df <- df %>%
dplyr::mutate(alter.as1 = round(as.integer(difftime(erstelltAm, geburtsdatum.as1 , units = 'days'))/365),
alter.as2 = round(as.integer(difftime(erstelltAm, geburtsdatum.as2, units = 'days'))/365),
hauptantragstellerAlter = dplyr::if_else(einkommen.as1 >= einkommen.as2, alter.as1, alter.as2,
missing = alter.as1)) %>%
dplyr::select(-contains('geburtsdatum'))
return(df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.