Skip to contents

Renders one centroid-anchored circle per polygon row, sized proportionally to count_col. Useful for showing per-district incident counts without colour-coding the polygons themselves.

Usage

morie_tps_render_district_proportional(
  polys,
  count_col,
  max_radius_km = 3,
  outfile = NULL
)

Arguments

polys

data.frame with one row per polygon, including a centroid_lat / centroid_lon (or LAT_WGS84 / LONG_WGS84) and the count column.

count_col

Name of the numeric column.

max_radius_km

Largest symbol radius in km.

outfile

Optional output path.

Value

ggplot object or invisible NULL.

Examples

set.seed(1)
polys <- data.frame(centroid_lat = runif(6, 43.62, 43.82),
                    centroid_lon = runif(6, -79.55, -79.20),
                    n = c(5, 12, 3, 8, 20, 9))
out <- morie_tps_render_district_proportional(polys, "n",
                                              outfile = tempfile(fileext = ".png"))