Subsetting a data frame to the rows not appearing in another data frame

后端 未结 5 952
温柔的废话
温柔的废话 2021-01-23 13:53

I have a data frame A with observations

    Var1   Var2  Var3
     1       3    4
     2       5    6
     4       5    7
     4       5    8
     6       7    9         


        
5条回答
  •  灰色年华
    2021-01-23 14:47

    Another option:

    C <- rbind(A, B)
    C[!(duplicated(C) | duplicated(C, fromLast = TRUE)), ]
    

    Output:

      Var1 Var2 Var3
    3    4    5    7
    4    4    5    8
    5    6    7    9
    

提交回复
热议问题