Skip to contents

K(r) = |A| n^-2 sum_i sum_{j != i} w_ij 1(d_ij <= r) with the isotropic edge correction, without which K is biased downwards near the window boundary. Under complete spatial randomness K(r) = pi r^2; L = sqrt(K/pi) is the variance-stabilised form.

Usage

morie_ripley_k(coords, r_grid, area = NULL, edge_correction = TRUE)

Arguments

coords

n x 2 matrix of point coordinates

r_grid

radii at which to evaluate K

area

window area; the bounding box by default

edge_correction

apply the isotropic correction

Value

list with r, K, L, csr_K and intensity

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
D <- data.frame(x = c(1, 2, 3, 4), y = c(2, 4, 5, 9))
morie_ripley_k(D, V)
#> $r
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $K
#> [1]  0.000000  3.500000  8.536788 24.521274 27.146274 29.771274 29.771274
#> [8] 32.396274
#> 
#> $L
#> [1] 0.000000 1.055502 1.648437 2.793808 2.939545 3.078391 3.078391 3.211239
#> 
#> $csr_K
#> [1]   3.141593  12.566371  28.274334  50.265482  78.539816 113.097336 153.938040
#> [8] 201.061930
#> 
#> $n
#> [1] 4
#> 
#> $area
#> [1] 21
#> 
#> $intensity
#> [1] 0.1904762
#>