I have a dataset with many duplicated rows, and I would like to isolate only non duplicated values. my df looks something like this
df <- data.frame("group" = c("A", "A", "A","A","A","B","B","B"),
"id" = c("id1", "id2", "id3", "id1", "id2","id1","id2","id1"),
"Val" = c(10,10,10,10,10,12,12,12))
What I would like to extract are only the rows that do not have a duplicate. i.e. my final dataset should look like this
final <- data.frame("group" = c("A","B"),
"id" = c("id3","id2"),
"Val" = c(10,12))
Note I am not interested in finding unique values, but rather non duplicated ones.
I know how to find unique values, for instance df %>% distinct()
does the job. it is individuating non-duplicated rows that I am struggling with