Skip to contents

Wraps the TPS Public Safety Data Portal "Mental Health Act Apprehensions" layer (one row per police-attended MHA event). Carries both HOOD_158 and HOOD_140 columns – callers should pick a version via morie_tps_resolve_hood_col() before downstream analysis.

Usage

morie_datasets_tps_mha_apprehensions(
  year = NULL,
  max_features = NULL,
  offline = TRUE,
  layer_url = NULL
)

Arguments

year

Optional reporting year filter (applies an OCC_YEAR = <year> WHERE clause when offline = FALSE).

max_features

Optional cap on returned rows (offline = FALSE only).

offline

If TRUE (default), read the bundled synthetic fixture from inst/extdata/tps_mha_apprehensions_sample.csv (5 rows in the canonical TPS PSDP 22-column schema). If FALSE, hit the TPS PSDP ArcGIS FeatureServer.

layer_url

Optional ArcGIS layer URL override.

Value

A data.frame.

References

TPS Public Safety Data Portal, "Mental Health Act Apprehensions Open Data" (https://data.tps.ca/datasets/333c4e1c96314741a83425045b6a7642_0/explore).

Examples

df <- morie_datasets_tps_mha_apprehensions(offline = TRUE)
table(df$APPREHENSION_TYPE)
#> 
#> MHA Section 16 MHA Section 17 MHA Section 33 
#>              2              2              1