[R-sig-Geo] Cross nearest neighbor distance

Rolf Turner r.turner at auckland.ac.nz
Mon Sep 5 04:37:02 CEST 2011


On 04/09/11 23:49, Alper ALTINOK wrote:
>
> Dear list,
>
> I have abot 10 set of points from same area, each set taken at different time periods (ie, one set is from May, other set is from June). Many of the points are exact same location, some are slightly different, very few are far apart. I want to compare point locations of pairs of these sets (may<->june,  june<->july etc.) to see how different or similar their point locations are. Despite my all efforts on finding a useful function in R or other stat packages, I could not find anything to reveal spatial dis/similarity between two point sets.
>
> The only method I was able to find is "Cross Nearest Neighbor Distance (V)", but I do not know how to apply it, do you know any package in R that provides this or a similar function ?
>
> I know there is a Kcross function in R, what I understand is its for a single (but multitype) point pattern.
>
> Looking for advices,

It is not clear to me just what you are trying to do and hence it is not
clear what (if any) the appropriate technique might be.   What do the
points actually consist of?  Are the points in the June pattern translations
(by varying amounts) of the points in the May pattern.  If so, it would seem
to me that you have a number of *trajectories* of points, observed at
``about 10'' (???) discrete times.  In which case point pattern analysis may
not be appropriate.

Be that as it may, you could apply the Kcross() function to your data by
combining your ``about 10'' patterns into a single pattern with marks
indicating the month in which the pattern was observed.  To combine the
patterns, use "superimpose()".  E.g. (triv. example with simulated data):

require(spatstat)
X <- list()
set.seed(42)
for(nm in month.abb) X[[nm]] <- rpoispp(100)
Y <- do.call(superimpose,X)
marks(Y) <- factor(marks(Y),levels=month.abb) # To get the months in the 
right order
kc <-alltypes(Y,fun="K")
plot(kc[1:4,1:4],title="Vacuous Example") # 12 x 12 makes the plots too 
small to be useful.

HTH

     cheers,

         Rolf Turner



More information about the R-sig-Geo mailing list