calc_age | R Documentation |
This function is just a convenient wrapper to calculate age using lubridate.
calc_age(dob, ref_date = Sys.Date())
dob |
Starting date or datetime (usually date of birth). |
ref_date |
Ending date or datetime |
calc_age(dob = as.Date("1974-03-14"))
birth_days <- sample(seq(as.Date("1999/01/01"), as.Date("2000/01/01"), by = "day"), 5)
follow_ups <- data.frame(dob = birth_days, last_checkup = Sys.Date())
follow_ups %>%
dplyr::mutate(age_last_fu = calc_age(dob, last_checkup))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.