Hello All:
I have the following question

# instantiate a date
current = as.Date("2009/10/25")

#generate a sequence of dates in the future
future_dates = seq(current,by='1 week',length=53)

Question: How to generate a sequence of past dates starting one week in the 
past relative to the current date. Obviously, what I wrote below is not 
correct. I think I can write a for loop and push each value into a vector. Is 
this the best way? Thanks.

Satish


past_dates = seq(current,by=-'1 week',length=156)

______________________________________________
R-help@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.

Reply via email to