Calculates the age of individuals at a given date,
based on their date of birth. This uses lubridate
functions
to calculate an age, which means that leap years are also taken into account.
get_age(DOB, Date)
DOB | vector of |
---|---|
Date | vector of |
birthdays <- lubridate::dmy(c("01/01/1990", "29/02/1992", "31/12/2000", "15/06/1995")) get_age(birthdays, lubridate::today())#> [1] 30 28 19 25