Specific removing all duplicates with R [duplicate]
问题 This question already has answers here : Finding ALL duplicate rows, including “elements with smaller subscripts” (5 answers) Remove all duplicate rows including the “reference” row [duplicate] (3 answers) Closed 4 years ago . For example I have two columns: Var1 Var2 1 12 1 65 2 68 2 98 3 49 3 24 4 8 5 67 6 12 And I need to display only values which are unique for column Var1: Var1 Var2 4 8 5 67 6 12 I can do you like this: mydata=mydata[!unique(mydata$Var1),] But when I use the same formula