Skip to contents

Select-incident-type annual summary

Usage

morie_datasets_corrections_uof_select_incident_summary(
  offline = TRUE,
  resource_id = NULL,
  source = NULL
)

Arguments

offline

Logical; TRUE (default) reads the included real CKAN sample at inst/extdata/corrections_uof_incidents_sample.csv. FALSE hits the live CKAN endpoint.

resource_id

Optional CKAN resource id override.

source

One of "auto", "live", "included", "synthetic", "empty"; takes precedence over offline when supplied.

Value

A data.frame of the requested dataset (a 0-row typed frame when the data is unavailable offline).

Examples

df <- morie_datasets_corrections_uof_select_incident_summary()
head(df)
#>   year incident_type
#> 1 2023       Assault
#> 2 2023       Assault
#> 3 2023       Assault
#> 4 2023       Assault
#> 5 2023       Assault
#> 6 2023       Assault
#>                                                                  level_one
#> 1                                            (P1) Serious Inmate on Inmate
#> 2                          (P1) Serious Inmate on Staff (Requires contact)
#> 3             (P2) Inmate on Inmate - No serious injury or hospitalization
#> 4                                          (P2) Inmate on Member of Public
#> 5 (P2) Inmate on Staff - No Serious Injury or Hospitalization - No contact
#> 6                                                         Other or Unknown
#>   number_of_incidents
#> 1                  65
#> 2                 188
#> 3                1041
#> 4                   3
#> 5                 539
#> 6                  47