我无法使用library(Rblpapi)
blpConnect()
opt <- c("periodicitySelection"="QUARTERLY")
ovrd <- c("DS215" = "USD")
mylist1 <- bdh(c("MA EQUITY", "FB EQUITY","TSLA EQUITY"), c("IS010",
"IS033"), start.date=Sys.Date()-365.25*1, options=opt, overrides=ovrd)
使代码动态化。这就是我所拥有的:
$`MA EQUITY`
date IS010 IS033
1 2016-12-31 2756 1363
2 2017-03-31 2734 1506
3 2017-06-30 3053 1653
$`FB EQUITY`
date IS010 IS033
1 2016-12-31 8809 4566
2 2017-03-31 8032 3327
3 2017-06-30 9321 4401
$`TSLA EQUITY`
date IS010 IS033
1 2016-12-31 2284.631 -266.698
2 2017-03-31 2696.270 -257.549
3 2017-06-30 2789.557 -240.916
输出结果为:
rbind
我可以使用rbind(mylist1[[1]],mylist1[[2]],mylist1[[3]])
date IS010 IS033
1 2016-12-31 2756.000 1363.000
2 2017-03-31 2734.000 1506.000
3 2017-06-30 3053.000 1653.000
4 2016-12-31 8809.000 4566.000
5 2017-03-31 8032.000 3327.000
6 2017-06-30 9321.000 4401.000
7 2016-12-31 2284.631 -266.698
8 2017-03-31 2696.270 -257.549
9 2017-06-30 2789.557 -240.916
得到我想要的东西:
lapply
当我有更大的数据源时,有没有办法让lapply(mylist1, function(x) {rbind(as.data.frame(startDF),as.data.frame(x))})
循环播放?我试过这个:
//First add the headers
for (int i = 0; i < dataList.Count; i++)
{
worksheet.Cells[1, i + 1].Value = dataList[i];
}
但它不起作用......
请帮助,谢谢!