Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

compute_age

Compute age values


Description

Computes the age given a birth year or a birth date

Usage

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

Salary Analysis by the Swiss Federal Office for Gender Equality

v0.1.0
GPL-3
Authors
Jonathan Chassot [aut, cre], Jeremy Kolly [ctb], Federal Office for Gender Equality of Switzerland [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.