age_calc | R Documentation |
Calculate age, by Jason P Becker, modified very slightly in how arguments are passed to the function.
age_calc(dob, enddate = Sys.Date(), units = c("days","months","years"), precise = TRUE)
dob |
POSIXlt or Date. Birthday |
enddate |
POSIXlt or Date. Date to compute age |
units |
string. Choose a unit. |
precise |
Boolean. |
Jason P Becker
http://blog.jsonbecker.com/2013/12/calculating-age-with-precision-in-r.html
age_calc (dob=strptime("29OCT2002", format="%d%b%Y"),
enddate=strptime("30OCT2003", format="%d%b%Y"), units='years', precise=TRUE)
age_calc (dob=strptime("29OCT2002", format="%d%b%Y"),
enddate=strptime("30DEC2003", format="%d%b%Y"), units='years', precise=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.