Correct calculation of ages in years using lubridate periods. Leap year calculations work as well.
age_years(start, end = if (is_date(start)) Sys.Date() else Sys.time())age_months(start, end = if (is_date(start)) Sys.Date() else Sys.time())
Integer vector of age in years or months.
Start date/datetime, typically date of birth.
End date/datetime. Default is current date/datetime.