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.
FRED changed the URL scheme from http:// to https://. I'm working on determining a patch that will work on all platforms. The current code still works for me on Windows if --internet2
is set.
On unix-alikes, one potential solution is to add method="curl"
or method="wget"
to the download.file
call in getSymbols.FRED
.
Another (temporary) solution is to call one of the following before the actual getSymbols
script:
options(download.file.method="libcurl")
oroptions(download.file.method="wget")
oroptions(download.file.method="wininet")
The first option works for me (on Mac).
Thanks Paul Gilbert from Rmetrics (bottom post)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With