Pairwise distances between two point patterns on a linear network
Computes the distances between pairs of points taken from two different point patterns on the same linear network.
## S3 method for class 'lpp': crossdist(X, Y, \dots, method="C")
- Point patterns on a linear network (objects of class
"lpp"). They must lie on the same network.
- String specifying which method of calculation to use.
Given two point patterns on a linear network, this function computes the Euclidean distance from each point in the first pattern to each point in the second pattern, measuring distance by the shortest path in the network.
This is a method for the generic function
for point patterns on a linear network
(objects of class
This function expects two point pattern objects
on the same linear network,
and returns the matrix whose
[i,j] entry is the
shortest-path distance from
method is not normally used. It is
retained only for checking the validity of the software.
method = "interpreted" then the distances are
computed using interpreted R code only. If
(the default) then C code is used.
The C code is much faster.
- A matrix whose
[i,j]entry is the distance from the
i-th point in
j-th point in
v <- split(chicago) X <- v$cartheft Y <- v$burglary d <- crossdist(X, Y)