age_in_years: Compute complete years between events.

View source: R/percent.R

age_in_yearsR Documentation

Compute complete years between events.

Description

Computes number of yearly anniversaries between two dates. Useful for computing tha age of a person at death or some other event.

Usage

age_in_years(begin_date, end_date)

Arguments

begin_date

Beginning date (usually birth).

end_date

Ending date (usually death).

Value

Number of anniversaries of begin_date (usually person's age).

Examples

# Dave Brubeck
age_in_years("1920-12-06", "2012-12-05")
# John F. Kennedy
age_in_years("1917-05-29", "1963-11-22")
# Elvis Presley
age_in_years("1935-01-08", "1977-08-16")
# Groucho Marx
age_in_years("1890-10-02", "1977-08-19")

mlaviolet/tidyepi documentation built on May 14, 2022, 10:04 p.m.