R4crim
Notes for learning and applying R to questions about crime and the justice system
Project maintained by gregridgeway
Hosted on GitHub Pages — Theme by mattgraham
R4crim
Notes for learning and applying R to questions about crime and the justice system
Best viewed at the R4crim github.io site
These notes form the basis of Penn Criminology’s Criminal Justice Data Science course that I have taught since 2014. Students code in R to answer questions like
- What happens to crime when big movies come out?
- Where are Chicago’s crime hotspots?
- Which crimes happen inside LA’s gang injunction areas?
- If the police shoot someone, do they tranfer them to the nearest hospital?
On the way to answering these questions students learn about
- regular expressions
- SQL
- web scraping
- parallel processing
- geographic data
- official data sources (NIBRS, NCVS, ACS, OATH, Open data portals), and
- a variety of data and coding skills
Table of contents
- Intro to R and US protests
- Dates and times and New York City summonses
- Regular expressions
- Working with the National Crime Victimization Survey data
- Working with the National Incident-Based Reporting System and SQL databases
- Open data portals and mapping Chicago crime hotspots
- Webscraping, parallel processing, and the effect of movies on crime
- Extracting data from text, geocoding, and Philadelphia police shootings
- Working with geographic data and Los Angeles gang injunctions