| complaint_sample | R Documentation |
A CRAN-safe slice of the City of Chicago "Crimes – 2001 to present" dataset
(reported incidents), filtered to geocoded rows from 2020 onward. For the
full dataset use chiload("complaints", full = TRUE).
complaint_sample
A base data.frame with up to 25,000 rows and 16 columns:
Chicago PD records-division number (character).
Incident timestamp as an ISO-8601 string with offset (lossless across R/Python).
Incident timestamp as POSIXct (America/Chicago).
Illinois Uniform Crime Reporting code (character).
Primary FBI crime classification.
Secondary description of the offense.
Whether an arrest was made (logical).
Whether domestic-violence related (logical).
Geographic area codes (integer).
FBI crime code (character).
Year of the incident (integer).
WGS84 coordinates (numeric).
City of Chicago Open Data Portal, "Crimes - 2001 to present"
(dataset ijzp-q8t2). https://data.cityofchicago.org/
chiload
data(complaint_sample)
dim(complaint_sample)
str(complaint_sample)
# Most common offense types.
head(sort(table(complaint_sample$primary_type), decreasing = TRUE), 5)
# Arrest rate among reported incidents.
mean(complaint_sample$arrest)
# Incidents per year (the sample spans 2020+).
table(complaint_sample$year)
# Domestic-violence-flagged incidents by type.
head(sort(table(complaint_sample$primary_type[complaint_sample$domestic]),
decreasing = TRUE
), 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.