[R] How to create sequence in month

MacQueen, Don macqueen1 at llnl.gov
Mon Jul 12 20:15:00 CEST 2010


As in this example:

> seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by="mon")


On 7/12/10 11:25 AM, "Bogaso Christofer" <bogaso.christofer at gmail.com>
wrote:

> Hi all, can anyone please guide me how to create a sequence of months? Here
> I have tried following however couldn't get success
> 
>  
> 
>> library(zoo)
> 
>> seq(as.yearmon("2010-01-01"), as.yearmon("2010-03-01"), by="1 month")
> 
> Error in del/by : non-numeric argument to binary operator
> 
>  
> 
> What is the correct way to do that?
> 
>  
> 
> Thanks for your time.
> 
> 
> [[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.
> 

-- 
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
925 423-1062



More information about the R-help mailing list