nnmark: Mark of Nearest Neighbour

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Given a marked point pattern dataset X this function computes, for each desired location y, the mark attached to the nearest neighbour of y in X. The desired locations y can be either a pixel grid or the point pattern X itself.

Usage

1
nnmark(X, ..., k = 1, at=c("pixels", "points"))

Arguments

X

A marked point pattern (object of class "ppp").

...

Arguments passed to as.mask to determine the pixel resolution.

k

Single integer. The kth nearest data point will be used.

at

String specifying whether to compute the values at a grid of pixel locations (at="pixels") or only at the points of X (at="points").

Details

Given a marked point pattern dataset X this function computes, for each desired location y, the mark attached to the point of X that is nearest to y. The desired locations y can be either a pixel grid or the point pattern X itself.

The argument X must be a marked point pattern (object of class "ppp", see ppp.object). The marks are allowed to be a vector or a data frame.

If the argument k is given, then the k-th nearest neighbour will be used.

Value

If X has a single column of marks:

If X has a data frame of marks:

Author(s)

\adrian \rolf

and \ege

See Also

Smooth.ppp, marktable, nnwhich

Examples

1
2
3
4
5
6
  plot(nnmark(ants))
  v <- nnmark(ants, at="points")
  v[1:10]
  plot(nnmark(finpines))
  vf <- nnmark(finpines, at="points")
  vf[1:5,]

spatstat.geom documentation built on April 15, 2021, 9:06 a.m.