[R] Incrementing Dates

Gabor Grothendieck ggrothendieck at gmail.com
Wed Apr 23 02:42:02 CEST 2008


Try:

Sys.Date() + 1
seq(Sys.Date(), length = 2, by = "month")[2]
seq(Sys.Date(), length = 2, by = "year")[2]

R News 4/1 has an article on dates.


On Tue, Apr 22, 2008 at 8:17 PM, Worik R <worikr at gmail.com> wrote:
> How can I increment the value of a Date class?
>
> I want to add a day, month or year to a date.
>
> cheers
> Worik
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list