Render a TPS point-pattern map (incident dots, optional DBSCAN)
Source:R/tps_render.R
morie_tps_render_points.RdProjects (LAT_WGS84, LONG_WGS84) to the rotated Toronto canvas and
draws one dot per incident. When eps_km and min_samples
are supplied AND the dbscan package is installed, points are
coloured by DBSCAN cluster label.
Usage
morie_tps_render_points(
df,
category = "Assault",
eps_km = NULL,
min_samples = 20L,
outfile = NULL,
show_top = 12L,
fig_w = 12,
fig_h = 7.5
)Arguments
- df
A TPS data.frame with columns
LAT_WGS84andLONG_WGS84.- category
Optional category label used in the title.
- eps_km
DBSCAN neighbourhood radius in km. When
NULLno clustering is run.- min_samples
DBSCAN minimum cluster size.
- outfile
Path to write the image, or
NULLto return the plot.- show_top
Cap on how many clusters appear in the legend.
- fig_w, fig_h
Figure size.