R parity of morie.tps_spatial: Moran's I (global), LISA
(local Moran's Ii) for hot/cold spots, and 2-D kernel density
estimation of incident lat/long. Each function accepts a
data.frame of incident-level rows with a neighbourhood id
column plus WGS84 lat/long columns, and returns a named
list carrying numeric outputs alongside a multi-paragraph
interpretation so the result prints in a notebook without
further post-processing.
Details
Spatial weights are built with an internal base-R k-nearest-
neighbours routine; if the optional FNN package is installed
it is used for the KNN graph. The 2-D kernel density estimator
prefers MASS::kde2d when available, otherwise falls
back to a Gaussian density evaluated at the observation points.
If spdep is installed, callers can delegate the global
Moran's I test to spdep::moran.test via the
use_spdep = TRUE switch.
Functions
morie_tps_morans_i_neighbourhood: global Moran's I on neighbourhood-level incident counts.morie_tps_local_morans_i: LISA (local Moran's Ii) per neighbourhood with HH/LL/HL/LH quadrant classification.morie_tps_kde_density: 2-D kernel density estimate of geocoded incident points.