pairdist.psp {spatstat} | R Documentation |
Computes the matrix of distances between all pairs of line segments in a line segment pattern.
## S3 method for class 'psp': pairdist(X, ..., method="Fortran")
X |
A line segment pattern (object of class "psp" ).
|
... |
Ignored. |
method |
String specifying which method of calculation to use.
Values are "Fortran" and "interpreted" .
Usually not specified.
|
This function computes the distance between each pair of
line segments in X
, and returns the matrix of distances.
This is a method for the generic function pairdist
for the class "psp"
.
Distances are calculated using the Hausdorff metric. The Hausdorff distance between two line segments is the maximum distance from any point on one of the segments to the nearest point on the other segment.
The argument method
is not normally used. It is
retained only for checking the validity of the software.
If method = "interpreted"
then the distances are
computed using interpreted R code only. If method="Fortran"
(the default) then Fortran code is used. The Fortran code is somewhat faster.
A square matrix whose [i,j]
entry is the distance
between the line segments numbered i
and j
.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
crossdist
,
nndist
,
pairdist.ppp
L <- psp(runif(10), runif(10), runif(10), runif(10), owin()) D <- pairdist(L)