Quantmod 错误“无法打开 URL" [英] Quantmod Error 'cannot open URL'
问题描述
我今天开始遇到 quantmod 包的错误.其他人在运行此代码(或一般请求符号)时有同样的错误吗?
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)?
库(quantmod)getSymbols("CPIAUCNS",src="FRED")
错误:下载文件中的错误(粘贴(FRED.URL,/",符号[[i]],/",下载数据/",:无法打开 URL 'http://research.stlouisfed.org/fred2/series/CPIAUCNS/downloaddata/CPIAUCNS.csv'
网址本身工作正常.
推荐答案
另一种(临时)解决方案是在实际的 getSymbols
脚本之前调用以下之一:
Another (temporary) solution is to call one of the following before the actual getSymbols
script:
options(download.file.method="libcurl")
或options(download.file.method="wget")
或options(download.file.method="wininet")
第一个选项对我有用(在 Mac 上).
感谢来自 Rmetrics 的 Paul Gilbert(底部帖子)
The first option works for me (on Mac).
Thanks Paul Gilbert from Rmetrics (bottom post)
这篇关于Quantmod 错误“无法打开 URL"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!