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, ..., method="C", check=TRUE)
Point patterns on a linear network (objects of class
String specifying which method of calculation to use
when the network data use the non-sparse representation.
Logical value specifying whether to check that
Given two point patterns on a linear network, this function computes the distance from each point in the first pattern to each point in the second pattern, measuring distance by the shortest path along the network.
This is a method for the generic function
for the class of 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
If two points cannot be joined by a path,
the distance between them is infinite (
method is not normally used. It is
retained only for developers to check the validity of the software.
A matrix whose
[i,j] entry is the distance
i-th point in
j-th point in
Matrix entries are nonnegative numbers or infinity (
Distances are accurate within the numerical tolerance of the
For network data stored in the non-sparse
representation described in
then pairwise distances are computed using the matrix of path distances
between vertices of the network, using R code if
method = "interpreted", or using C code if
method="C" (the default).
For networks stored in the sparse representation,
method has no effect, and the distances are
computed using an efficient C algorithm.
v <- split(chicago) X <- v$cartheft Y <- v$burglary d <- crossdist(X, Y) d[1:3,1:4]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.