Skip to content

quantmod getSymbols

3 messages · Khanh Nguyen, Spencer Graves, Jeff Ryan

#
Hi,

I downloaded a yahoo.csv file for Yahoo from Yahoo Finance. It has this format

Date,Open,High,Low,Close,Volume,Adj Close
2009-05-28,141.65,145.29,139.29,144.65,14803100,144.65
2009-05-27,142.22,145.49,140.01,140.01,16696900,140.01
2009-05-26,134.61,142.07,134.61,142.05,13768700,142.05
2009-05-22,137.78,138.99,136.05,136.35,9058400,136.35
2009-05-21,134.05,139.45,133.92,137.16,16135500,137.16
...

when I try to read it to quantmod, I got
Error in `[.data.frame`(x, indx) : undefined columns selected

What am I missing? Thanks.

-k
#
From, e.g., "http://www.google.com/finance?q=yahoo", I found that 
the NASDAQ stock symbol for Yahoo is "YHOO".  With this info, the 
following read and stored an "xts" object "YHOO": 


getSymbols("YHOO")
str(YHOO)


      Hope this helps. 
      Spencer Graves
Khanh Nguyen wrote:
#
Khanh,

To follow up to the list with the solution.

This is a (bad) result of ordering an xts object that is read in in
non-ascending time order.

xts has been patched on R-forge now to properly handle this.

Thanks for the report!

Jeff
On Fri, May 29, 2009 at 3:21 PM, Khanh Nguyen <knguyen at cs.umb.edu> wrote: