meanNeighborsBi: Mean number of neighbors for different neighborhood sizes for...

View source: R/neighborsPointPattern.R

meanNeighborsBiR Documentation

Mean number of neighbors for different neighborhood sizes for a bivariate points

Description

Calculate mean number of second level factor points as a function of the distances from the first level factor points.

Usage

meanNeighborsBi(
  x,
  y,
  code,
  xlim = c(0, 1),
  ylim = c(0, 1),
  rMax = min(c(xlim[2], ylim[2]))/4,
  step = rMax/100,
  ways = c("order", "reverse", "both")
)

Arguments

x, y

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

code

factor vector with two levels and same length as 'x' and 'y'

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.

ways

type of bivariate calculation: 'order' uses first levels as target points; 'reverse' uses second level as target points; 'both' calculate the two bivariates means.

Value

'meanNeighborsBi' returns a data frame with numeric vectors. The first 'r' represents the neighborhood distance definition; 'meanNeighbors_12' 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.