A package with DC’s crime data from 2006-01-01 through 2012-07-17.
Last updated: 2012-07-17
Earliest data: 2006-01-01
You can find crime definitions here.
I include a data dictionary in the form of a csv file. This will need to be updated because it currently mixes variables definitions and variable value definitions.
- XBLOCK coordinates
- 105 XBLOCK coordinates from Ward 5 have XBLOCK coordinates that are two orders of magnitude off.
crime_data$XBLOCK[crime_data$XBLOCK > 40000000] <- crime_data$XBLOCK[crime_data$XBLOCK > 40000000] / 100
- 49 XBLOCK coordinates appear to be an order of magnitude too low (39k-40k)
crime_data$XBLOCK[crime_data$XBLOCK > 39000 & crime_data$XBLOCK < 41000] <- crime_data$XBLOCK[crime_data$XBLOCK > 39000 & crime_data$XBLOCK < 41000] * 10
- 105 XBLOCK coordinates from Ward 5 have XBLOCK coordinates that are two orders of magnitude off.
- YBLOCK coordinates
- 2 YBLOCK coordinates are an order of magnitude too high
- 1423925.0 is divided by 10
- 1742951.8 is divided by 10 and the first two digits are transposed
- Some YBLOCK coordinates are an order of magnitude too low (12000-15000)
- 2 YBLOCK coordinates are an order of magnitude too high
- CCN
- 79 CCN values are missing. No other variables have any missing values.
Location is approximated to the center of the street block. Values are in the Maryland State Plane meters NAD 83 map projection.
Sexual assualt data is not available before 2009.
Setup instructions to get the data or update the package.
- Download from github:
git clone git://github.com/eshilts/dc_crime_data.git
- Build and install
bq. R
library(devtools)
build()
install() - Load and use
bq. library(dccrimedata)
crime_data <- load_crime_data_by_ward()
- Visit the DC crime data search page
- Select Other Geographic Area or Point
- Select Wards from the drop down box
- Select each ward in turn (1 – 8)
- Click Other option button
- Set From: date to 01/01/2006 (earliest date available)
- Click the Search button
- Click the red Download Crime Data link
- Click the red Check all link
- Click the Get Data button
- Save the resulting file as wardX.csv in the data directory.