age.in.years: Compute Age From Date-of-Birth

age.in.yearsR Documentation

Compute Age From Date-of-Birth

Description

Computes the age of a person (in years) on a specified date from the person's date of birth.

Usage

age.in.years(on.this.date, birth.date)

Arguments

on.this.date

A vector of Date objects. The date on which the age is to be computed.

birth.date

A vector of Date objects. The date-of-birth.

Value

An integer vector containing the age in years.

Author(s)

Benjamin Rich <mail@benjaminrich.net>

See Also

difftime

Examples

age.in.years(
  as.Date(c("2012-03-01", "2012-02-29", "2012-02-28")),
  as.Date(c("1980-02-03", "1980-02-29", "1980-05-28")))

benjaminrich/PCSmisc documentation built on Feb. 11, 2024, 9:25 p.m.