get_age: Calculates ages

Description Usage Arguments Examples

View source: R/get_age.R

Description

Calculates the age of individuals at a given date, based on their date of birth. This uses lubridate functions to calculate an age, which means that leap years are also taken into account.

Usage

1
get_age(DOB, Date)

Arguments

DOB

vector of Date objects to be used as the date of birth

Date

vector of Date objects to be used as the date at which the age is requested

Examples

1
2
birthdays <- lubridate::dmy(c("01/01/1990", "29/02/1992", "31/12/2000", "15/06/1995"))
get_age(birthdays, lubridate::today())

MyKo101/mutils documentation built on July 28, 2020, 8:52 p.m.