powered by
Compute the age in years of an individual based on the birth date and another (subsequent) date
age(from, to)
A vector of ages (in years)
a vector of dates (birth dates)
a vector of current dates
Claus Ekstrom claus@rprimer.dk
Returns the full number of years that a person is old on a given date.
as.POSIXlt
born <- c("1971-08-18", "2000-02-28", "2001-12-20") check <- c("2016-08-28") age(born, check)
Run the code above in your browser using DataLab