Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

has.close

Check Whether Points Have Close Neighbours


Description

For each point in a point pattern, determine whether the point has a close neighbour in the same pattern.

Usage

has.close(X, r, Y=NULL, ...)

  ## Default S3 method:
has.close(X,r, Y=NULL, ..., periodic=FALSE)

  ## S3 method for class 'ppp'
has.close(X,r, Y=NULL, ..., periodic=FALSE, sorted=FALSE)

  ## S3 method for class 'pp3'
has.close(X,r, Y=NULL, ..., periodic=FALSE, sorted=FALSE)

Arguments

X,Y

Point patterns of class "ppp" or "pp3" or "lpp".

r

Threshold distance: a number greater than zero.

periodic

Logical value indicating whether to measure distances in the periodic sense, so that opposite sides of the (rectangular) window are treated as identical.

sorted

Logical value, indicating whether the points of X (and Y, if given) are already sorted into increasing order of the x coordinates.

...

Other arguments are ignored.

Details

This is simply a faster version of (nndist(X) <= r) or (nncross(X,Y,what="dist") <= r).

has.close(X,r) determines, for each point in the pattern X, whether or not this point has a neighbour in the same pattern X which lies at a distance less than or equal to r.

has.close(X,r,Y) determines, for each point in the pattern X, whether or not this point has a neighbour in the other pattern Y which lies at a distance less than or equal to r.

The function has.close is generic, with methods for "ppp" and "pp3" and a default method.

Value

A logical vector, with one entry for each point of X.

Author(s)

See Also

Examples

has.close(redwood, 0.05)
  with(split(amacrine), has.close(on, 0.05, off))
  with(osteo, sum(has.close(pts, 20)))

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.