Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想 rbind 所有a数据帧ALIST- 我该怎么做?
a
ALIST
alist <- list(a = data.frame(1:3), b = data.frame(4:6), a = data.frame(7:9)) (ALIST <- list(alist, alist, alist))
用于lapply子集您想要的元素,并rbind在do.call该列表中使用:
lapply
rbind
do.call
do.call("rbind",lapply(ALIST,function(x) x[["a"]])) X1.3 1 1 2 2 3 3 4 1 5 2 6 3 7 1 8 2 9 3