Learn R Programming

descutils (version 1.0)

difftime_years: Calculate the Time Difference in Years

Description

Code from Dirk Eddelbuettel via Stackoverflow (https://stackoverflow.com/a/15569373/1844418)

Usage

difftime_years(t2, t1)

Value

numeric. t2 - t1 [years]

Arguments

t2

end time of the interval. Will be coerced to Date

t1

starting time of the interval. Will be coerced to Date

Author

Andreas Leha

Examples

Run this code
difftime_years("2003-04-05", "2001-01-01")

Run the code above in your browser using DataLab