compute_age: Compute age values

Description Usage Arguments Value

View source: R/data_transformation.R

Description

Computes the age given a birth year or a birth date

Usage

1
compute_age(x, age_spec = NULL, reference_year = NULL)

Arguments

x

a string or number vector to be transformed

age_spec

a string indicating the age specification, can be one of NULL, "age", "birthyear", or "date_of_birth". If this parameter is set to NULL, the function automatically tries to infers the specification

reference_year

a number indicating the reference year in order to compute the age from a birth year or birth date. If age_spec is "age", this parameter can be ignored.

Value

a numeric vector of ages


logib documentation built on Aug. 27, 2020, 5:06 p.m.