maxnndist | R Documentation |
A faster way to compute the minimum or maximum nearest-neighbour distance in a point pattern.
minnndist(X, positive=FALSE, by=NULL)
maxnndist(X, positive=FALSE, by=NULL)
X |
A point pattern (object of class |
positive |
Logical. If |
by |
Optional. A factor, which separates |
These functions find the minimum and maximum values
of nearest-neighbour distances in the point pattern X
.
minnndist(X)
and maxnndist(X)
are
equivalent to, but faster than, min(nndist(X))
and max(nndist(X))
respectively.
The value is NA
if npoints(X) < 2
.
A single numeric value (possibly NA
).
If by
is given, the result is a numeric matrix
giving the minimum or maximum nearest neighbour distance
between each subset of X
.
.
nndist
min(nndist(swedishpines))
minnndist(swedishpines)
max(nndist(swedishpines))
maxnndist(swedishpines)
minnndist(lansing, positive=TRUE)
if(interactive()) {
X <- runifrect(1e6)
system.time(min(nndist(X)))
system.time(minnndist(X))
}
minnndist(amacrine, by=marks(amacrine))
maxnndist(amacrine, by=marks(amacrine))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.