By default the data frames are merged on the columns with names they both have,
but separate specifications of the columns can be given by by.x and by.y.
这显然意味着 merge将基于多个列合并数据帧。根据文件中给出的最后一个例子:
x <- data.frame(k1=c(NA,NA,3,4,5), k2=c(1,NA,NA,4,5), data=1:5)
y <- data.frame(k1=c(NA,2,NA,4,5), k2=c(NA,NA,3,4,5), data=1:5)
merge(x, y, by=c("k1","k2")) # NA's match