| pairdist.lpp | R Documentation |
Given a pattern of points on a linear network, compute the matrix of distances between all pairs of points, measuring distance by the shortest path in the network.
## S3 method for class 'lpp'
pairdist(X, ..., method="C")
X |
Point pattern on linear network (object of class |
method |
Optional string determining the method of calculation.
Either |
... |
Ignored. |
Given a pattern of points on a linear network, this function computes the matrix of distances between all pairs of points, measuring distance by the shortest path in the network.
If two points cannot be joined by a path,
the distance between them is infinite (Inf).
The argument method is not normally used. It is
retained only for developers to check the validity of the software.
A symmetric matrix, whose values are nonnegative numbers or infinity
(Inf).
Distances are accurate within the numerical tolerance of the
network, summary(X)$toler.
For network data stored in the non-sparse
representation described in linnet,
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,
the argument method has no effect, and the distances are
computed using an efficient C algorithm.
The values returned by pairdist(X) are distances,
expressed as multiples of the unit of length of the spatial
coordinates in X.
The unit of length is given by unitname(X).
Note that, if the unit of length in X is a composite
expression such as ‘2 microns’,
then the values of pairdist(X) are expressed as multiples
of 2 microns, rather than being expressed in microns.
and \adrian.
lpp
X <- runiflpp(12, simplenet)
d <- pairdist(X)
d[1:3, 1:3]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.