countNeighbors: Count neighbors around

View source: R/neighborsPointPattern.R

countNeighborsR Documentation

Count neighbors around

Description

Count number of neighbor for each point for a given r distance neighborhood

Usage

countNeighbors(x, y, xlim = c(0, 1), ylim = c(0, 1), r = 0.1)

Arguments

x, y

Numeric vectors with 'x' and 'y' coordinates in a cartesian space. They must have the same length.

xlim, ylim

Numeric vectors with two values defining the 'x' and 'y' axis limit in the cartesian plane.

r

dis.tance for neighborhood definition.

Value

'countNeighbors' returns a integer vector with counts the number of neighbors around each point at the maximum distance 'r'

Author(s)

Alexandre Adalardo de Oliveira aleadalardo@gmail.com

References

Baddeley, A.; Rubak, E; Turner, R. 2016. Spatial Point Patterns: Methodology and Applications with R. CRC Press.

Wiegand, T. & Moloney, K.A. 2014. Handbook of Spatial Point-Pattern Analysis in Ecology. CRC Press.

Examples

## Not run: 
countNeighbors(x = runif(100, 0, 100), y = runif(100, 0, 100), xlim= c(0,100), ylim = c(0,100), r = 10)

## End(Not run)


adalardo/Rppsp documentation built on June 10, 2025, 1:11 p.m.