请问各位大哥大姐,R语言中getSymbols函数不能获取数据是啥情况?

啊翁啊翁啊翁 |浏览1355次
收藏|2017/05/20 01:18

我使用这条命令:getSymbols("AAPL",from="2011-02-02",to="2011-06-30")

结果出现如下结果:

Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  : 

  cannot open URL 'https://ichart.finance.yahoo.com/table.csv?s=AAPL&a=1&b=02&c=2011&d=5&e=30&f=2011&g=d&q=q&y=0&z=AAPL&x=.csv'

In addition: Warning message:

In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  :

  cannot open URL 'https://ichart.finance.yahoo.com/table.csv?s=AAPL&a=1&b=02&c=2011&d=5&e=30&f=2011&g=d&q=q&y=0&z=AAPL&x=.csv': HTTP status was '502 Connection refused'

请问这是什么原因?我该怎么处理?先提前谢过愿意帮忙的各位大哥大姐了!


满意回答

2017/05/20 10:11

下面是我导师昨天给我发的邮件,内容如下:

For those who need to use the function getSymbols from the package quantmod, you will need to install a new version of quantmod since Yahoo!Finance changes the url at which the data is available and the old version of quantmod is thus referencing the wrong url. Since this is a recent correction of the code, it is not yet available on CRAN but needs to be downloaded from the package author's github page. 

crystal8832

其他回答(0)    我来补答
  • 下面是我导师昨天给我发的邮件,内容如下:

    For those who need to use the function getSymbols from the package quantmod, you will need to install a new version of quantmod since Yahoo!Finance changes the url at which the data is available and the old version of quantmod is thus referencing the wrong url. Since this is a recent correction of the code, it is not yet available on CRAN but needs to be downloaded from the package author's github page. 

    回答于 2017/05/20 04:07
0人关注该问题
+1
 加载中...