从 R 导入股息时出错
I got an error while importing dividend from R
我正在尝试从 R 导入股息。有些股票有错误,我不知道它们是什么意思。
以下是我使用的代码:
library(quantmod)
mdate <- "2016-01-04"
edate <- "2016-09-03"
Tick <- c("FAM","FCT","FEI","MAIN","WSR","ERF","ETB","ETG","ETJ","ETV","ETW",
"ETX","ETY","EVG","EVN","EVT","EXG","KIO","MNE","MNP","MPA","MQT",
"MQY","MTR","MTT","MUA","MUB","MUC","MUE","MUH","MUI","MUJ","MUNI",
"MUS","MVF","MVT","MYC","MYD","MYF","MYI","MYJ")
Dividend_160104 <-
lapply(Tick,
function(x) {
try(getDividends(x, from= mdate, to= edate, src="yahoo"),
silent = TRUE)
})
names(Dividend_160104) <- Tick
随着符号,从第19个是“MNE”开始,出现错误; “open.connection(文件,“rt”)中的错误
如果我 运行 只有几个符号,没有错误,但我有三千多个符号。
几天前,我格式化了我的硬盘并在我的移动硬盘中重新安装了 R。是因为这个吗?有人知道为什么会这样吗?
这在一定程度上与对雅虎无效的代码有关。 MNE 不是有效的代码,会报错。由于此问题会影响股息的获取方式,因此此处的错误也会导致以下代码失败。
有关详细信息,请参阅 github issue 314。在撰写本文时,开发人员正在处理此问题。
我正在尝试从 R 导入股息。有些股票有错误,我不知道它们是什么意思。
以下是我使用的代码:
library(quantmod)
mdate <- "2016-01-04"
edate <- "2016-09-03"
Tick <- c("FAM","FCT","FEI","MAIN","WSR","ERF","ETB","ETG","ETJ","ETV","ETW",
"ETX","ETY","EVG","EVN","EVT","EXG","KIO","MNE","MNP","MPA","MQT",
"MQY","MTR","MTT","MUA","MUB","MUC","MUE","MUH","MUI","MUJ","MUNI",
"MUS","MVF","MVT","MYC","MYD","MYF","MYI","MYJ")
Dividend_160104 <-
lapply(Tick,
function(x) {
try(getDividends(x, from= mdate, to= edate, src="yahoo"),
silent = TRUE)
})
names(Dividend_160104) <- Tick
随着符号,从第19个是“MNE”开始,出现错误; “open.connection(文件,“rt”)中的错误 如果我 运行 只有几个符号,没有错误,但我有三千多个符号。 几天前,我格式化了我的硬盘并在我的移动硬盘中重新安装了 R。是因为这个吗?有人知道为什么会这样吗?
这在一定程度上与对雅虎无效的代码有关。 MNE 不是有效的代码,会报错。由于此问题会影响股息的获取方式,因此此处的错误也会导致以下代码失败。
有关详细信息,请参阅 github issue 314。在撰写本文时,开发人员正在处理此问题。