I have a date in R, e.g.:
dt = as.Date('2010/03/17')
I would like to subtract 2 years from this date, without worrying about leap years and such issues, getting as.Date('2010-03-17')
.
How would I do that?
With lubridate
library(lubridate)
ymd("2010/03/17") - years(2)