Skip to content
Prev 201388 / 398502 Next

Adding to the years ...

There is some question of what should be returned if its Feb 29th and
in 6 years Feb only has 28 days; however, that aside
try this which does not involve any internals and works for both Date
and chron dates:
+ for(i in seq_along(x)) x[i] <- tail(seq(x[i], len = 7, by = "year"), 1)
+ x
+ }
[1] "2006-02-28" "2006-03-01" "2006-03-01"
[1] 02/28/06 02/28/06 03/01/06
On Mon, Nov 23, 2009 at 9:06 PM, Rolf Turner <r.turner at auckland.ac.nz> wrote: