Try this:

seq(as.Date("2005-01-15"), len = 2, by = "month")[2]

or here is another approach:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/61570.html

On 10/11/05, t c <[EMAIL PROTECTED]> wrote:
>
> Within an R dataset, I have a date field called "date_".  (The dates are in 
> the format "YYYY-MM-DD", e.g. "1995-12-01".)
>
>
>
> How can I add or subtract "1 month" from this date, to get "1996-01-01" or " 
> "1995-11-01".
>
>
>
>
>
> ---------------------------------
>
>        [[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to