I have the following data frame:
id x2 x3 x4 x5
id1 3 6 5 4
id1 10 8 7 9
id2 11 6 8 4
id3 20 25 26 2
id4 10 2 4 9
id4 1 4 3 2
I found duplicate cases through duplicated(x). Now, I need to remove id1 and id4 as duplicates id and have a new data frame as follow:
id x2 x3 x4 x5
id2 11 6 8 4
id3 20 25 26 2
how can I do it?