Suppose there are two point patterns in spatstat. I understand we can superimpose these two point patterns to get a single point pattern. Now if there are common coordinates for these patterns but with different marks, then the points will be duplicated when superimposed. Is there a way in spatstat to get a unique set of points while creating a common mark for the coordinates that coincide?
Combining two point pattern objects in spatstat creating a combined mark
535 Views Asked by user2167741 At
1
I’m not aware of a built-in solution to do this, so you have to do a bit of manual work as detailed below.
Load package and make example data with overlapping points:
For each point in
X1
find the nearest point inX2
:Add extra mark level to
X1
and assign it to points with duplicates inX2
: