Computes Ripley's K(r) at each user-supplied radius (km), the Besag-centred L(r)-r transformation, and the CSR baseline pi*r^2. Coordinates are projected to km via the small-angle latitude factor; for typical city-scale point patterns this is accurate enough that haversine is unnecessary.
Usage
morie_tps_ripley_k(
df,
ds_name = "?",
radii_km = c(0.25, 0.5, 1, 2, 3, 5),
max_n = 5000L,
lat_col = "LAT_WGS84",
lon_col = "LONG_WGS84"
)Examples
set.seed(2026)
df <- data.frame(
LAT_WGS84 = 43.6 + rnorm(80, 0, 0.04),
LONG_WGS84 = -79.4 + rnorm(80, 0, 0.04)
)
morie_tps_ripley_k(df, radii_km = c(0.5, 1, 2))
#> Ripley's K -- ?
#> ===============
#> Call: morie_tps_ripley_k(df=<80r>)
#>
#> Points used 80
#> Bounding-box area (km^2) 306.6
#> Intensity (pts/km^2) 0.261
#> Radii (km) 0.5, 1, 2
#> Clustered radii 3
#>
#> Across 80 point(s) with intensity 0.261 points/km^2, K(r) exceeds the Poisson CSR baseline at 3 of 3 radii (=> clustering at those scales). The Besag L(r)-r ranges from +0.153 to +0.401; positive values indicate clustering, negative values regularity.