I will borrow an example for this question of the same name: Remove duplicated rows using dplyr
set.seed(123)
df = data.frame(x=sample(0:1,10,replace=T),y=sample(0:1,10,replace=T),z=1:10)
> df
x y z
1 0 1 1
2 1 0 2
3 0 1 3
4 1 1 4
5 1 0 5
6 0 1 6
7 1 0 7
8 1 0 8
9 1 0 9
10 0 1 10
df[!duplicated(df[,1:2]),]
x y z
1 0 1 1
2 1 0 2
4 1 1 4
The problem with the example is that it keeps one row and removes other duplicate rows. I need to completely remove all duplicate rows.
The final result should only have one row that is unique:
x y z
4 1 1 4
Already answered here: How can I remove all duplicates so that NONE are left in a data frame?
Thank you Jaap. I promise I searched, a lot, and all results I found were like the example I posted.