Skip to contents

TPS PSDP – Hate Crimes

Usage

morie_datasets_tps_hatecrimes(
  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 included 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.

Examples

df <- morie_datasets_tps_hatecrimes(offline = TRUE)
head(df[, c("OCCURRENCE_YEAR", "PRIMARY_OFFENCE", "RACE_BIAS",
            "ARREST_MADE")])
#>   OCCURRENCE_YEAR     PRIMARY_OFFENCE   RACE_BIAS ARREST_MADE
#> 1            2023      Mischief Under        NONE          No
#> 2            2023             Assault       Black         Yes
#> 3            2024         Threatening        NONE          No
#> 4            2024 Assault With Weapon South Asian         Yes
#> 5            2025         Threatening        NONE          No