在这里,我用
bind_rows
从
dplyr
打包而不是
merge
.
L <- list(structure(list(a = 5L, b = 2L, c = 4L, d = 10L, e = 1L), class = "data.frame", row.names = c(NA,
-1L)), structure(list(a = 6L, b = 7L, c = 4L, d = 6L, e = 1L), class = "data.frame", row.names = c(NA,
-1L)), structure(list(a = 7L, b = 3L, c = 5L, d = 5L), class = "data.frame", row.names = c(NA,
-1L)), structure(list(a = 5L, b = 2L, c = 6L, d = 5L), class = "data.frame", row.names = c(NA,
-1L)), structure(list(a = 4L, b = 4L, c = 2L, d = 8L), class = "data.frame", row.names = c(NA,
-1L)))
library(dplyr)
Reduce(bind_rows, L)
#> a b c d e
#> 1 5 2 4 10 1
#> 2 6 7 4 6 1
#> 3 7 3 5 5 NA
#> 4 5 2 6 5 NA
#> 5 4 4 2 8 NA
创建日期:2019-02-09
reprex package
(V0.2.1.9000)