We can use duplicated
dat[!(duplicated(dat$ID)|duplicated(dat$ID, fromLast = TRUE)),]
0
solved Keep only non-duplicate rows based on a Column Value [duplicate]
We can use duplicated
dat[!(duplicated(dat$ID)|duplicated(dat$ID, fromLast = TRUE)),]
0
solved Keep only non-duplicate rows based on a Column Value [duplicate]