0

I have the following dataframe in R

ID b  c  d  
1  33 33 35  
2  33 33 35  
3  32 34 36  
4  33 33 35  
5  32 33 35  
6  33 33 35  

My desire is to find out the rows with different values compare to other rows. In this case, the rows with different values will be ID3 and ID5.

Can anyone help me on this?

Thanks

r2evans
  • 141,215
  • 6
  • 77
  • 149
jli323
  • 115
  • 6
  • 3
    You can negate the approach provided [here](https://stackoverflow.com/questions/7854433/finding-all-duplicate-rows-including-elements-with-smaller-subscripts) - `df[!(duplicated(df[2:4]) | duplicated(df[2:4], fromLast = TRUE)),]`. – Ritchie Sacramento Aug 05 '19 at 23:52
  • 1
    Or a `dplyr` approach `df %>% group_by_at(2:4) %>% filter(n() == 1)` followed by an optional `ungroup()` if necessary. – Maurits Evers Aug 06 '19 at 00:28

0 Answers0