Re: [R] Help with R loop for URL download from FRED to create US time series

2013-06-10 Thread jim holtman
This should do it for you: > base <- "http://research.stlouisfed.org/fred2/data/"; > > files <- lapply(state.abb, function(.state){ + cat(.state, "\n") + input <- read.table(paste0(base, .state, "RGSP.txt") + , skip = 11 + , header = TRUE +

[R] Help with R loop for URL download from FRED to create US time series

2013-06-10 Thread arum
I am downloading time series data from FRED. I have a working download, but I do not want to write out the download for all 50 states likes this: IDRGSP <- read.table('http://research.stlouisfed.org/fred2/data/IDRGSP.txt', skip=11, header=TRUE) IDRGSP$DATE <- as.Date(IDRGSP$DATE, '%Y-%m-%d') IDRGS