Distance Map of Point Pattern
Computes the distance from each pixel to the nearest point in the given point pattern.
## S3 method for class 'ppp': distmap(X, \dots)
- A point pattern (object of class
- Arguments passed to
as.maskto control pixel resolution.
The ``distance map'' of a point pattern $X$ is the function
$f$ whose value
f(u) is defined for any two-dimensional
location $u$ as the shortest distance from $u$ to $X$.
This function computes the distance map of the point pattern
and returns the distance map as a pixel image. The greyscale value
at a pixel $u$ equals the distance from $u$ to the nearest
point of the pattern
Additionally, the return value
has two attributes,
"bdry", which are
also pixel images. The grey values in
"bdry" give the
distance from each pixel to the bounding rectangle of the image.
The grey values in
"index" are integers identifying which
X is closest.
This is a method for the generic function
Note that this function gives the distance from the
centre of each pixel to the nearest data point.
To compute the exact distance from a given spatial location
to the nearest data point in
- A pixel image (object of class
"im") whose greyscale values are the values of the distance map. The return value has attributes
"bdry"which are also pixel images.
Nearest neighbour distance
data(cells) U <- distmap(cells) plot(U) plot(attr(U, "bdry")) plot(attr(U, "index"))