
Global Moran's I + DBSCAN summary on TPS lat/long event data
Source:R/mrm_tps.R
mrm_tps_moran_clustering.RdGrids the lat/long extent of data into a coarse raster of
grid_resolution cells, counts events per cell, and computes the
global Moran's I via a rook contiguity matrix. Also runs DBSCAN on
the raw lat/long points (rescaled to km) and reports cluster
counts.
Events at the TPS unknown-location placeholder (0, 0), with missing
coordinates, or outside the Toronto bounding box (latitude 43.55 to
43.90, longitude -79.65 to -79.10) are dropped first.
Usage
mrm_tps_moran_clustering(
data,
lat_col = "LAT_WGS84",
lon_col = "LONG_WGS84",
grid_resolution = 40L,
dbscan_eps = 0.3,
dbscan_minpts = 5L
)Value
A list with morans_I, morans_z, dbscan_n_clusters,
dbscan_n_noise, dbscan_largest, n_events (events used) and
n_dropped_coords (events dropped for an unusable location).
Details
This function is a thin computational wrapper. For high-precision
computations on full-sized TPS files use the morie Python
tps_spatial_advanced pipeline; the R version is for quick
interactive auditing.
Examples
if (FALSE) {
tps <- read.csv("Assault_Open_Data.csv")
mrm_tps_moran_clustering(tps)
}