The function uniquemap
is generic, with methods for
point patterns and data frames.
This function determines whether any points of x
are
duplicated, and constructs a mapping of the indices of x
so that all duplicates are mapped to a unique representative index.
The result is an integer vector u
such that
u[j] = i
if
the points x[i]
and x[j]
are identical and
point i
has been chosen as the unique representative.
The entry u[i] = i
means either that point i
is
unique, or that it has been chosen as the unique representative
of its equivalence class.