age: Compute the age of a person from two dates.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Compute the age in years of an individual based on the birth date and another date

Usage

1
age(from, to)

Arguments

from

a vector of dates (birth dates)

to

a vector of current dates

Details

For linear interpolation the auc function computes the area under the curve using the composite trapezoid rule. For area under a spline interpolation, auc uses the splinefun function in combination with the integrate to calculate a numerical integral. The auc function can handle unsorted time values, missing observations, ties for the time values, and integrating over part of the area or even outside the area.

Value

A vector of ages (in years)

Author(s)

Claus Ekstrom claus@rprimer.dk

See Also

as.POSIXlt

Examples

1
2
3
born <- c("1971-08-18", "2000-02-28", "2001-12-20")
check <- c("2016-08-28")
age(born, check)


Search within the MESS package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.