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!