你可以用几个包来做到这一点.但是这里是如何用基础R做的.
df1 <-matrix(1:6,ncol=2,byrow=TRUE)
df2 <-matrix(1:10,ncol=2,byrow=TRUE)
all <-rbind(df1,df2) #rbind the columns
#use !duplicated fromLast = FALSE and fromLast = TRUE to get unique rows.
all[!duplicated(all,fromLast = FALSE)&!duplicated(all,fromLast = TRUE),]
[,1] [,2]
[1,] 7 8
[2,] 9 10
Run Code Online (Sandbox Code Playgroud)