TPS Mental Health Act Apprehensions (PSDP)
Source:R/datasets_ontario_tps.R
morie_datasets_tps_mha_apprehensions.RdWraps 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 whenoffline = FALSE).- max_features
Optional cap on returned rows (
offline = FALSEonly).- offline
If
TRUE(default), read the bundled synthetic fixture frominst/extdata/tps_mha_apprehensions_sample.csv(5 rows in the canonical TPS PSDP 22-column schema). IfFALSE, hit the TPS PSDP ArcGIS FeatureServer.- layer_url
Optional ArcGIS layer URL override.
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