使用quantmod包从Yahoo导入数据的问题

时间:2018-03-18 05:50:40

标签: r quantmod

library(quantmod)
startDate = as.Date("2010-01-04")
endDate = as.Date("2015-01-08")
getSymbols("CAT", from=startDate,to=endDate)

我使用的是R版本3.2.3。

我有如下错误:

trying URL 'http://ichart.finance.yahoo.com/table.csv?s=SPY&a=0&b=01&c=2007&d=2&e=16&f=2018&g=d&q=q&y=0&z=SPY&x=.csv'
Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
cannot open URL 'http://ichart.finance.yahoo.com/table.csv?s=SPY&a=0&b=01&c=2007&d=2&e=16&f=2018&g=d&q=q&y=0&z=SPY&x=.csv'
In addition: Warning message:
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
InternetOpenUrl failed: 'The server name or address could not be resolved'

0 个答案:

没有答案