Description Usage Arguments Value Author(s) Source See Also Examples
his function calculates age in days, months, or years from a date of birth to another arbitrary date. This returns a numeric vector in the specified units.
1 |
dob |
a vector of class |
enddate |
a vector of class Date representing the when the observation's age is of interest, defaults to current date. |
units |
character, which units of age should be calculated? allowed values are days, months, and years |
precise |
logical indicating whether or not to calculate with leap year and leap second precision |
A numeric vector of ages the same length as the dob vector
Jason P. Becker
This function was developed in part from this response on the R-Help mailing list.
See also difftime
which this function uses and mimics
some functionality but at higher unit levels.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.