Description Usage Arguments Examples
View source: R/calc_age_in_yrs.R
This function calculates age in years as of a certain date, correctly accounting for leap years. You could also use it to calculate years between any two dates.
1 | calc_age_in_yrs(birth_dt, as_of_dt)
|
birth_dt |
Input birthdate as a string with formatting YYYY/MM/DD (e.g., "1981/02/25") |
as_of_dt |
Input date at which age is to be calculated as a string with formatting YYYY/MM/DD (e.g., "2019/05/21") |
1 2 3 4 5 6 | ## Not run:
born <- "1981/02/25"
yesterday <- Sys.Date() - 1
calc_age_in_yrs(born, yesterday)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.