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
+
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
2 matches
Mail list logo