[R-SIG-Finance] Help on getSymbols
Dan Mack
dmack10 at verizon.net
Sat Apr 9 14:39:07 CEST 2016
Josh, I have been using the get symbols to bull data from Yahoo via the following code and generally works well.
FromDate = "2002-05-24"
ToDate = "2016-03-17"
userInput=c("SHW","ABC","LEN","PCLN","HAR","ETN","RRC","PNR","MO","MAT","SNDK","EW","SPLS","AGN","F","MMM",
"SWK","EA","KSU","MLM","FCX","XRAY","BDX","DOW","LUK","PHM","TMO","DHI","COH","HOT","STZ","LOW","ADS”,
"SWN","REGN","CSC","VFC","CI","HPQ","CA","TE","PWR","RF","BAX")
for (i in userInput)
{
getSymbols(Symbols=userInput, src="yahoo", from = FromDate, to = ToDate, auto.assign=TRUE, return.class="data.frame")
}
My issue is that many times it takes a really long time to complete, like upwards to 20-30 minutes. Sometimes the process terminate with an error message. I am trying to replicate it, but no luck right now it is just running. The error indicated something about a header being off.
I have a hunch that something is not recognizing the download has completed and can’t terminate the call.
I do notice that when I manually stop the get symbols call after a short time ( 1-2 minutes) all of my data I asked for will be in the global environment.
This is preventing some automation I would like to do for my models.
Do you have any suggestion on what could be causing this or any solutions?
Thanks Dan
More information about the R-SIG-Finance
mailing list