[R] Distances between two datasets of x and y co-ordinates

Adrian Baddeley adrian at maths.uwa.edu.au
Thu Mar 18 05:21:25 CET 2010


Tom_R wrote:

 > How do I  use nncross to measure min distances between
 > point patterns i,j, ENSURING each point in pattern i
 > is only connected to a single partner point  in pattern j ?
 > I do realise that there are many possible pairings
 > between the i-j point pairs... perhaps some average
 > min distance for many pairings would be better.
 > Alternatively pairings could be randomly assigned.
 >
 > Basically, i am tracking a population of moving objects
 > over time, and want to indirectly estimate the collective
 > movement- which might be better estimated by telling
 > nncross to randomly assign (somehow) paired nearest
 > neighbour distances ; 1-to-1 rather than  many-to-one.

See the function 'pppdist' in the 'spatstat' package. This function 
determines the optimal pairing between two point patterns X and Y, and 
(optionally) returns the optimized (average or maximum) distance.
There are related functions pppmatching and matchingdist which will 
create other kinds of pairings and measure the associated distances.
These functions were written by Dominic Schuhmacher.

Adrian Baddeley



More information about the R-help mailing list