Hello, I'm trying to load a weeks worth of files that are each named by the date they were creaded (e.g., 20110601.RData), starting with the day before today so if today is June 1, I would like to load 20110525- 20110531. The script was working until today, and x= 20110593 20110594 20110595 20110596 20110597 20110598 20110599 20110600. time=Sys.time() t1<- as.numeric(format.Date(time, "%Y%m%d")) #date range of data to load t1=t1-1 t0 <-t1-7 x = t0:t1 Any solutions? Thanks
load seven files (named by date) at a time
3 messages · PIKAL Petr, Mathew Brown
Hi
[R] load seven files (named by date) at a time Hello, I'm trying to load a weeks worth of files that are each named by the date they were creaded (e.g., 20110601.RData), starting with the day before today so if today is June 1, I would like to load 20110525- 20110531. The script was working until today, and x= 20110593 20110594 20110595 20110596 20110597 20110598 20110599 20110600. time=Sys.time() t1<- as.numeric(format.Date(time, "%Y%m%d")) #date range of data to load t1=t1-1 t0 <-t1-7 x = t0:t1 Any solutions?
work with dates not numbers seq(as.Date(time)-7, as.Date(time)-1, by=1) Regards Petr
Thanks
______________________________________________ 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.
Awesome, thanks a lot!
On 6/1/2011 11:22 AM, Petr PIKAL wrote:
seq(as.Date(time)-7, as.Date(time)-1, by=1)