I would like to detect all duplicates of coordinates of an object, which means that I want to keep one of every kind, but mark all the other ones. If I try:
for(bb in 1:nrow(Cons)){
  for(cc in 1:nrow(Cons)){
    if(identical(Cons$lat[bb], Cons$lat[cc])&& identical(Cons$lng[bb], Cons$lng[cc])&& !identical(bb,cc)){
      Cons$X[bb] <- NA
    }
  }
}
Then I get every pair of coordinates marked. Any ideas how I can keep the first one?
 
     
     
    