我有这三个数据帧
df1
df2
,
df3
.
df1<- structure(list(ControlRate = structure(c(1L, 1L, 1L), .Label = c("24000",
"26000", "28000", "30000"), class = "factor"), Mean = c(92.914223793805,
125.810174859037, 152.350610715905)), row.names = c(NA, 3L), class = "data.frame")
df2 <- structure(list(ControlRate = structure(c(1L, 1L, 1L), .Label = c("24000",
"26000", "28000", "30000"), class = "factor"), SD = c(19.7498590603068,
33.5137097117632, 40.4792131612947)), row.names = c(NA, 3L), class = "data.frame")
df3 <- structure(list(ControlRate = structure(c(1L, 1L, 1L), .Label = c("24000",
"26000", "28000", "30000"), class = "factor"), Count = c(36L,
117L, 198L)), row.names = c(NA, 3L), class = "data.frame")
而不是使用
cbind(df1,df2$SD, df3$Count)
,我想按如下方式使用merge,但它不起作用。我在这里做错什么了?
Reduce(function(dtf1, dtf2) merge(dtf1, dtf2, by = "ControlRate", all.x = TRUE),
list(df1, df2, df3))