It sounds like some of the points might be duplicated within a data frame? Try
a1 <- a[,-ncol(a)]
a1[duplicated(a1),]
b1 <- b[,-ncol(b)]
b1[duplicated(b1),]
to see if there are any duplicate points.
Edit: Also, to get all the rows in a
that have duplicated points, you can do this:
a1 <- a[,-ncol(a)]
duplicated_points_a <- a1[duplicated(a1),]
merge(duplicated_points_a, a)