neighbors | R Documentation |
Compare distribution of marks to binomial distribution
neighbors(
pattern,
type = NULL,
window = NULL,
k_vec = 1,
drop_isolated = TRUE,
...
)
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 |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.