maxnndist

0th

Percentile

Compute Minimum or Maximum Nearest-Neighbour Distance

A faster way to compute the minimum or maximum nearest-neighbour distance in a point pattern.

Keywords
spatial, math
Usage
minnndist(X)
maxnndist(X)
Arguments
X
A point pattern (object of class "ppp").
Details

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.

Value

  • A single numeric value (possibly NA).

See Also

nndist

Aliases
  • maxnndist
  • minnndist
Examples
min(nndist(swedishpines))
  minnndist(swedishpines)

  max(nndist(swedishpines))
  maxnndist(swedishpines)

  if(interactive()) {
     X <- rpoispp(1e6)
     system.time(min(nndist(X)))
     system.time(minnndist(X))
  }
Documentation reproduced from package spatstat, version 1.37-0, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.