Skip to contents

Wraps the City of Chicago "Chicago Police Department - Illinois Uniform Crime Reporting (IUCR) Codes" reference table (Socrata resource id c7ck-438e; portal landing https://data.cityofchicago.org/Public-Safety/Chicago-Police-Department-Illinois-Uniform-Crime-R/c7ck-438e). 410 IUCR codes mapping the iucr foreign key carried by every morie_datasets_chicago_crime() row to a human-readable description. Five columns:

Usage

morie_datasets_chicago_iucr_codes(
  offline = TRUE,
  max_features = NULL,
  resource_id = NULL,
  mode = c("soda2", "soda3"),
  paginate = FALSE,
  page_size = 1000L,
  max_pages = 200L,
  app_token = NULL
)

Arguments

offline

If TRUE (default), read the bundled full 410-row fixture.

max_features

Optional row cap.

resource_id

Optional view id override.

mode

One of "soda2" (default JSON resource endpoint) or "soda3" (SoQL query endpoint). 3VV+ dual-mode dispatch.

paginate

Logical; 3OO opt-in pagination.

page_size

Per-page row count when paginating.

max_pages

Safety net.

app_token

Optional Socrata API app token for higher rate limits; passed as the X-App-Token header.

Value

A data.frame.

Details

iucr

4-character IUCR code (e.g. "110" for homicide).

primary_description

Top-level category (e.g. "HOMICIDE").

secondary_description

Subcategory (e.g. "FIRST DEGREE MURDER").

index_code

"I" (FBI index crime) or other.

active

TRUE if the code is currently active.

Available via SODA2 (single-shot or paginated) – this is a base dataset, not a filtered view.

Offline mode reads a bundled 410-row complete fixture (inst/extdata/chicago_iucr_codes.csv).

References

City of Chicago Data Portal, "Chicago Police Department - Illinois Uniform Crime Reporting (IUCR) Codes" (c7ck-438e).

Examples

df <- morie_datasets_chicago_iucr_codes(offline = TRUE)
subset(df, primary_description == "HOMICIDE")
#>    iucr primary_description    secondary_description index_code active
#> 17  110            HOMICIDE      FIRST DEGREE MURDER          I   True
#> 51  130            HOMICIDE     SECOND DEGREE MURDER          I   True
#> 64  141            HOMICIDE INVOLUNTARY MANSLAUGHTER          N   True
#> 68  142            HOMICIDE        RECKLESS HOMICIDE          N   True