Skip to contents

Wraps the Ontario Police Use-of-Force Race-Based Data Strategy resource. Offline mode reads a small bundled synthetic fixture from inst/extdata/arsau_uof_main_records_sample.csv (5 rows in the canonical 23-column subset of the 65-column upstream schema, clearly stamped SYNTHETIC-FIXTURE-XXX). Live mode hits the Ontario CKAN datastore-dump JSON endpoint for the requested reporting year.

Usage

morie_datasets_arsau_uof_main_records(
  year = "2024",
  offline = TRUE,
  resource_id = NULL
)

Arguments

year

Reporting year ("2023" or "2024"). Honoured only when offline = FALSE.

offline

If TRUE (default), read the bundled fixture. If FALSE, hit the live CKAN endpoint via httr2.

resource_id

Optional CKAN resource id override.

Value

A data.frame.

References

Ontario Open Data Catalogue, "Police Use of Force" (https://data.ontario.ca/dataset/police-use-of-force-race-based-data); Open Government Licence – Ontario.

Examples

df <- morie_datasets_arsau_uof_main_records(offline = TRUE)
head(df[, c("IncidentYear", "PoliceService", "IncidentType")])
#>   IncidentYear                  PoliceService IncidentType
#> 1         2024 Sample Regional Police Service       Weapon
#> 2         2024 Sample Regional Police Service       Person
#> 3         2024                            OPP       Weapon
#> 4         2024 Sample Regional Police Service       Animal
#> 5         2024                            OPP       Person