calcAge: Calculate the difference between two date in terms of unit of...

Description Usage Arguments Value Examples

View source: R/calcAge.R

Description

This function calculate the difference between two date in terms of unit of time, and age can be obtained when ‘year’ is specified as unit argument.

Usage

1
calcAge(birthday, targetdate = Sys.Date(), unit = "year")

Arguments

birthday

a character or character vector specifying birthday or base date.

targetdate

a character or character vector specifying target date.

unit

a character specifying unit for calculating the difference between the two dates. Values of "year", "month" and "day" are supported.

Value

a vector of age

Examples

1
calcAge("1963-2-3")

Example output

[1] 55

epifit documentation built on May 29, 2017, 3:43 p.m.