0

I've figured out how to load historical financial data from Google using the following code:

slb <- read.table( "slb.csv", header=TRUE, sep=",", col.names=c("date","open","high","low","close","volume") )
slb$date <- as.Date( slb$date, "%d-%b-%y" )
slb <- zoo( slb )

This works fine, but I'd like to accomplish this using the read.zoo() function, but I keep getting errors about "bad rows". Here is what I had tried using read.zoo().

slb <- read.zoo( "slb.csv", header=TRUE, sep=",", format="%d-%b-%y" )

Do you guys have any ideas for a one-liner? Thanks!

4

1 回答 1

1

以下似乎可以做到:read.zoo("http://www.google.com/finance/historical?q=NYSE%3ASLB&ei=SjFRU6jLKKGkwAPs2AE&output=csv", format="%d-%B-%y", header=TRUE, sep=",") 注意大写%B...

于 2014-04-18T14:11:53.287 回答