I am trying to get data from Yahoo! Finance to R
I\'ve installed quantmod like that:
install.packages(\"quantmod\", repos=\"http://R-Forge.R-project.
To answer the specific question asked:
getSymbols("QQQ;SPY", from="1997-12-31", src='yahoo')
works just fine - you get two xts
series, QQQ and SPY (note that QQQQ is "dead" and replaced with QQQ), with 6 columns Open
, High
, Low
, Close
, Volume
, Adjusted
.
It looks like you only want the close? If so, you can get just that series with
Cl(QQQ)
If you don't like auto-assignment, you can use
qqq.data <- getSymbols("QQQ", auto.assign=FALSE, from="1997-12-31", src='yahoo')
to assign the downloaded data to a variable of your choice. Note that most people would probably be interested in the adjusted price instead, if so, you can select it with
Ad(QQQ)
Finally, indeed, as pointed out, google finance no longer provides data through its API.