Calculate the date before / after months
Note
The function name is the same as the Excel function EDATE()
and
does the same. It returns the date that is the indicated number of months
before or after the ref date.
Examples
edate(as.Date("2020-01-31"), 1)
#> [1] "2020-02-29"
## supports 'YMD' formatted integer or string
edate(200131, 1)
#> [1] "2020-02-29"
edate(200229, -12)
#> [1] "2019-02-28"