Distance Map on Linear Network
Compute the distance function of a point pattern on a linear network.
## S3 method for class 'lpp': distfun(X, ...)
- A point pattern on a linear network
(object of class
- Extra arguments are ignored.
On a linear network $L$, the
is the shortest-path distance from $s$ to $A$.
distfun.lpp is a method for the generic command
for the class
"lpp" of point patterns on a linear network.
X is a point pattern on a linear network,
f <- distfun(X) returns a function
in the Rlanguage that represents the
distance function of
X. Evaluating the function
in the form
v <- f(x,y), where
are any numeric vectors of equal length containing coordinates of
spatial locations, yields the values of the distance function at these
locations. More efficiently
f can take the arguments
x, y, seg, tp where
tp are the local
coordinates on the network.
f obtained from
f <- distfun(X)
also belongs to the class
It can be printed and plotted immediately as shown in the Examples.
It can be
converted to a pixel image using
x,yand optional arguments
seg,tp. It also belongs to the class
"linfun"which has methods for
To identify which point is the nearest neighbour, see
data(letterR) X <- runiflpp(3, simplenet) f <- distfun(X) f plot(f) # using a distfun as a covariate in a point process model: Y <- runiflpp(4, simplenet) fit <- lppm(Y, ~D, covariates=list(D=f))