Re: [R] Vector of weekly dates starting with a given date

2011-03-09 Thread Gabor Grothendieck
On Wed, Mar 9, 2011 at 4:13 PM, Dimitri Liakhovitski wrote: > I realize I can do something like this: > date<-20081229 > mydates<-as.Date(as.character(date),"%Y%m%d") > for(i in 1:52){  # >  mydates<-c(mydates,mydates[length(mydates)]+7) > } > > I just thought maybe there is a more elegant way...

Re: [R] Vector of weekly dates starting with a given date

2011-03-09 Thread Hadley Wickham
On Wed, Mar 9, 2011 at 3:04 PM, Dimitri Liakhovitski wrote: > Hello! > > I have a date (a Monday): > > date<-20081229 > mydates<-as.Date(as.character(date),"%Y%m%d") > > What package would allow me to create a vector that starts with that > date (mydates) and contains dates for 51 Mondays that fol

Re: [R] Vector of weekly dates starting with a given date

2011-03-09 Thread Dimitri Liakhovitski
I realize I can do something like this: date<-20081229 mydates<-as.Date(as.character(date),"%Y%m%d") for(i in 1:52){ # mydates<-c(mydates,mydates[length(mydates)]+7) } I just thought maybe there is a more elegant way... Thank you! Dimitri On Wed, Mar 9, 2011 at 4:04 PM, Dimitri Liakhovitski