2015年8月21日星期五

[StackOverflow]quantmod-error-cannot-open-url


I started to experience an error today with the quantmod package. Anybody else have the same error when running this code (or requesting symbols in general)?
library(quantmod) getSymbols("CPIAUCNS",src="FRED")
Error:
Error in download.file(paste(FRED.URL, "/", Symbols[[i]], "/", "downloaddata/", : cannot open URL 'http://research.stlouisfed.org/fred2/series/CPIAUCNS/downloaddata/CPIAUCNS.csv'
The URL itself works fine.

Another (temporary) solution is to call one of the following before the actual getSymbols script:
options(download.file.method="libcurl")
or
options(download.file.method="wget")
or
options(download.file.method="wininet")
The first option works for me (on Mac).
Thanks Paul Gilbert from Rmetrics (bottom post)

没有评论:

发表评论