Learn R Programming

spatstat.geom (version 3.6-0)

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, ...)

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

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

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

Arguments

Value

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

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.

See Also

nndist

Examples

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

Run the code above in your browser using DataLab