age: Age

Description Usage Arguments Value Examples

Description

Calculate ages from CPR numbers.

Usage

1
age(cpr, date = Sys.Date(), unit = "year")

Arguments

cpr

Character vector of CPR numbers with or without hyphens.

date

Character or date vector of dates used in computation of ages. Dates provided as characters must follow the ISO standard, 'yyyy-mm-dd'.

unit

Character indicating the unit representing ages. Possible values are: 'year', 'month', 'week', 'day'.

Value

Numeric vector of ages. By default ages are computed in years. Note that year and month units are calculated by approximaion, 1 year = 365.25 days, 1 month = 30.44 days.

Examples

1
  age(c('1508631111', '1310762222'))

cprr documentation built on May 2, 2019, 9:16 a.m.

Related to age in cprr...