Skip to contents

High-level orchestration: takes a named list dfs of TPS open-data data.frames (one per CSI category) and returns both the per-year and per-ward CSI as a single rich-result object.

Usage

morie_tps_analyze_csi_from_dataframes(
  dfs,
  year_col = "OCC_YEAR",
  hood_col = "HOOD_158",
  variant = c("total", "violent")
)

Arguments

dfs

Named list of TPS data.frames. Keys outside of MORIE_TPS_CSI_CATEGORIES() are ignored.

year_col

Year column name (default "OCC_YEAR").

hood_col

Neighbourhood column name (default "HOOD_158").

variant

One of "total" or "violent" (default "total").

Value

A morie_tps_result named list carrying by_year and by_hood data.frames in payload.