City of Chicago Open Data – Arrests feed (dpt3-jri9)
Source: R/datasets.R
morie_datasets_chicago_arrests.RdWraps the City of Chicago "Arrests" open dataset (Socrata resource
id dpt3-jri9; portal landing
https://data.cityofchicago.org/Public-Safety/Arrests/dpt3-jri9/about_data).
24 columns covering up to four charges per arrest plus the
pipe-concatenated rollup quartet (charges_statute /
charges_description / charges_type / charges_class).
Usage
morie_datasets_chicago_arrests(
year = NULL,
max_features = NULL,
offline = TRUE,
resource_id = NULL,
mode = c("soda2", "soda3"),
paginate = FALSE,
page_size = 1000L,
max_pages = 200L,
app_token = NULL
)Arguments
- year
Integer or
NULL; server-side year filter (usesdate_extract_y(arrest_date) = <year>SoQL).- max_features
Integer or
NULL; cap on returned rows. Whenpaginate = TRUEthis is the total cap across walked pages.- offline
Logical; if
TRUE(default, safer post-3EE), read the bundled synthetic frame.- resource_id
Optional Socrata resource id override. Accepts the UUID (
dpt3-jri9, default) or the publisher's alias (arrests).- mode
One of
"soda2"(default JSON resource endpoint) or"soda3"(SoQLqueryendpoint). 3VV+ dual-mode dispatch.- paginate
Logical; if
TRUEandoffline = FALSE, walk SODA2$offsetinpage_sizechunks. DefaultFALSE.- page_size
Per-page row count when paginating (default 1,000, the unauthenticated SODA2 ceiling).
- max_pages
Safety net on paginated walks (default 200).
- app_token
Optional Socrata API app token for higher rate limits; passed as the
X-App-Tokenheader.
Details
Socrata accepts two resource specifiers interchangeably – the
numeric/UUID id (/resource/dpt3-jri9.json) and the human-readable
alias the publisher assigned (/resource/arrests.json). morie
defaults to the UUID for stability; pass resource_id = "arrests"
if you want to exercise the alias path.
Offline mode reads a bundled 5-row synthetic fixture
(inst/extdata/chicago_arrests_dpt3_jri9_sample.csv) carrying the
real upstream snake_case schema. Live mode hits the SODA2 endpoint
via .morie_dataset_socrata_fetch() and honours the 3OO opt-in
pagination (paginate = TRUE).