【问题标题】:r append/rbind identical tables contained in different list in a loopr 在循环中追加/绑定包含在不同列表中的相同表
【发布时间】:2021-06-17 01:35:51
【问题描述】:

给定下面的 C1 和 C2(这是一个简化):

a2 <- c("a","b","c")
A <- cbind(a1, a2)

b1 <- c("bergkamp","Van Basten")
b2 <- c("pires","wiltord")
B <- cbind(a1, a2)

C1 = list("A" =A, "B" = B)

a1 <- c(4,5,6)
a2 <- c("d","e","f")
A <- cbind(a1, a2)

b1 <- c("Overmars","Blind")
b2 <- c("Anelka","Zidane")
B <- cbind(a1, a2)

C2 = list("A" =A, "B" = B)

我怎样才能有一个列表,其中 C1 中的 A 附加到 C2 中的 A 与列表中具有相同名称的所有选项卡相同?谢谢。

【问题讨论】:

    标签: r list merge append


    【解决方案1】:

    Map + rbind 的另一个基本 R 选项

    Map(rbind,C1,C2)
    

    【讨论】:

    • 如果 C1 和 C2 是循环的输出。即 i = 1 的 C 和 i = 2 的 C。我试过:Final
    • @highbury_85 您能否详细说明您的问题?
    【解决方案2】:

    我们可以使用rbinddo.call

    do.call(rbind, c(C1, C2))
    

    【讨论】:

      猜你喜欢
      • 2018-11-16
      • 1970-01-01
      • 2018-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-10
      • 1970-01-01
      • 2013-09-16
      相关资源
      最近更新 更多