rbinding a list of lists of dataframes based on nested order

风格不统一 提交于 2019-12-02 07:45:57

Not very clean but you can try something like this (assuming the same data generation process).

list.aID <- lapply(1:4, function(x) {
cbind(list[[(2*x) - 1]], list[[2*x]][1, 1, drop = FALSE])
})

all.aID <- rbind.fill(list.aID)
all.aID

all.aID
        d1       d2 id1
1  0.68103 -0.74023   1
2 -0.50684  1.23713   2
3  0.33795 -0.37277   3
4  0.37827  0.56892   4
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!