Skip to contents

Years between two dates, rounded down to nearest whole number

Usage

years_floor(from, to)

Arguments

from

<date> Start date

to

<date> End date

Value

<int> vector; number of years between from and to, rounded down to nearest whole number

Examples

years_floor(
   as.Date("2020-01-01"),
   as.Date("2020-01-01") + 2057)
#> [1] 5