age_years | R Documentation |
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())
start |
Start date/datetime, typically date of birth. |
end |
End date/datetime. Default is current date/datetime. |
Integer vector of age in years or months.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.