meanNeighbors: Mean number of neighbors for different neighborhood sizes

View source: R/neighborsPointPattern.R

meanNeighborsR Documentation

Mean number of neighbors for different neighborhood sizes

Description

Calculate mean number of neighbors as a function of distances from each point

Usage

meanNeighbors(
  x,
  y,
  xlim = c(0, 1),
  ylim = c(0, 1),
  rMax = min(c(xlim[2], ylim[2]))/4,
  step = rMax/100
)

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.

rMax

maximum distance for neighborhood definition.

step

increase distance size for neighborhood.

Value

'meanNeighbors' returns a data frame with two numeric vectors. The first 'r' represents the neighborhood distance definition; 'meanNeighbors' the mean number of neighbors for each 'r' distance. This count uses the torus border correction.

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: 
meanNeighbors(x = runif(100, 0, 1), y = runif(100, 0, 1))

## End(Not run)

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