neighbors: Neighbors in shell

View source: R/rTEM_02.R

neighborsR Documentation

Neighbors in shell

Description

Compare distribution of marks to binomial distribution

Usage

neighbors(
  pattern,
  type = NULL,
  window = NULL,
  k_vec = 1,
  drop_isolated = TRUE,
  ...
)

Arguments

pattern

point pattern of class ppp or pp3

type

mark defining point type

window

object of class owin (for ppp) or box3 (for pp3). Only points inside the window are used to calculate distances from, but points outside the window are still included as potential neighbors. If NULL then it includes the entire domain of pattern

k_vec

an integer or vector of integers that determines which NN's to calculate

drop_isolated

if TRUE then points that are closer to a boundary than they are to their kth NN will be dropped: their distances are set to NA

Details

For each k in k_vec, calculate how many of the points in pattern with mark type have 0, 1, .. k points of mark type in their k nearest neighbors. This can then be compared to the expected values of a binomial distribution with n = k and p = fraction of points in pattern that have mark type


rolandrolandroland/rTEM documentation built on March 29, 2025, 2:17 p.m.