The problem I am trying to solve is looping a string through R with Yahoo! finance api. This would make a bunch of data frame files, but if I could convert it into xts
, that would be awesome. However, the xts
part is not as important.
library(quantmod)
DB <- quantmod:::DDB_Yahoo()
for (i in length(DB$db)){
symbols <- DB$db[i] #symbols are c('AAIT', 'AAL', 'AAME', ... #Thousands Essentially
URL <- "http://ichart.finance.yahoo.com/table.csv?s=symbols"
dat[i] <- read.csv(URL[i])
dat$Date <- as.Date(dat$Date, "%Y-%m-%d")
I know that we can't have symbols in ("") quotations, but it is for logical purposes.
p.s. For this instance, I am not using quantmod
functions on purpose.
if you want to directly read the file: