Re: [R] How to generate a sequence of dates without hardcoding the year

2010-07-26 Thread Felipe Carrillo
om: jim holtman > To: Felipe Carrillo > Cc: r-h...@stat.math.ethz.ch > Sent: Sat, July 24, 2010 4:02:57 PM > Subject: Re: [R] How to generate a sequence of dates without hardcoding the >year > > Is this what you want if you want to assume that the date without a > year is t

Re: [R] How to generate a sequence of dates without hardcoding the year

2010-07-24 Thread jim holtman
Is this what you want if you want to assume that the date without a year is this year: > seq(as.Date("7-1","%m-%d"),by="week", length=52) [1] "2010-07-01" "2010-07-08" "2010-07-15" "2010-07-22" "2010-07-29" "2010-08-05" "2010-08-12" "2010-08-19" [9] "2010-08-26" "2010-09-02" "2010-09-09" "2010-0

Re: [R] How to generate a sequence of dates without hardcoding the year

2010-07-24 Thread Henrique Dallazuanna
Try this: format(seq(as.Date("2008-07-01"),as.Date("2009-06-30"),by="week"), "%d/%m") On Sat, Jul 24, 2010 at 6:07 PM, Felipe Carrillo wrote: > Hi: > I have a dataframe named 'spring' and I am trying to add a new variable > named > 'IdDate' > This line of code works fine: > spring$idDate <- seq(