Learn R Programming

SciencesPo (version 1.02.12)

elapsed: Return Elapsed Time in Years

Description

Return the elapsed time in years.

Usage

elapsed(from, to, format)

Arguments

from
the date of origin, typically birthdate
to
the date up to compute the age
format
the date format see as.Date

encoding

UTF-8

Examples

Run this code
elapsed(from="1988-12-19", to="2014-12-31", format="%Y-%m-%d")

elapsed("1jan1960", "2jan1990", "%d%b%Y")

Run the code above in your browser using DataLab