R-side port of morie.tps_render. Carries the two design
rules from the Python module (per the author, 2026-05-07):
Details
No floating neighbourhood text labels on the map – hot-spot identification is delivered via the
morie_tps_*result tables, not via on-canvas text.Map is rotated approximately 17.5 degrees clockwise in projected space so Lake Ontario's shoreline sits level horizontally – matching the Sigar Li 2022 "Hotspot Policing for the City of Toronto" poster aesthetic and the Hohl 2024 ALMI homicide-cluster map.
Plotting back-ends are gated behind ggplot2; without it, the
callables fall back to base plot(). Heavy panels
(kernel-density, LISA, Getis-Ord, Kulldorff scan) that depend on
the Python TPS spatial modules are intentionally not ported here:
the projection + base choropleth / point-pattern primitives below
are enough for the empirical paper's figures.
Functions
morie_tps_project_xy: degrees -> rotated planar km.morie_tps_pretty_label:ASSAULT_RATE_2024->"Assault rate * 2024".morie_tps_district_for_centroid: lat/lon -> pre-1998 borough name.morie_tps_render_choropleth: polygon choropleth (ggplot2 if available, else base R).morie_tps_render_points: point-pattern map (incident dots + optional DBSCAN colouring).morie_tps_render_yearly_grid: small-multiples by year.