【发布时间】:2021-02-12 16:15:43
【问题描述】:
我有一个如下所示的数据集:
我想合并这两个数据集。我怎样才能做到这一点。我不能使用rbind,因为 df 有更多的变量。
可以使用代码构建示例数据:
df<-structure(list(ID = c(1, 2, 3), High = c(25, 36, 75), weight = c(38,
58, 36), date = c(1, 1, 1)), row.names = c(NA, -3L), class = c("tbl_df",
"tbl", "data.frame"))
df2<-structure(list(ID = c(1, 2, 3, 1, 2, 3), weight = c(69, 58, 35,
65, 24, 15), date = c(3, 3, 3, 2, 2, 2)), row.names = c(NA, -6L
), class = c("tbl_df", "tbl", "data.frame"))
【问题讨论】:
标签: r