Skip to content

eshilts/dc_crime_data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DC Crime Data

A package with DC’s crime data from 2006-01-01 through 2012-07-17.

About the data

Data history

Last updated: 2012-07-17
Earliest data: 2006-01-01

Data dictionary

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.

Cleaning the data

  • 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
  • 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)
  • CCN
    • 79 CCN values are missing. No other variables have any missing values.

Map coordinates

Location is approximated to the center of the street block. Values are in the Maryland State Plane meters NAD 83 map projection.

Sexual assault disclaimer

Sexual assualt data is not available before 2009.

Setup

Setup instructions to get the data or update the package.

Installation instructions

  1. Download from github:
    1. git clone git://github.com/eshilts/dc_crime_data.git
  2. Build and install
    bq. R
    library(devtools)
    build()
    install()
  3. Load and use
    bq. library(dccrimedata)
    crime_data <- load_crime_data_by_ward()

Updating crime data

  1. Visit the DC crime data search page
  2. Select Other Geographic Area or Point
  3. Select Wards from the drop down box
  4. Select each ward in turn (1 – 8)
  5. Click Other option button
  6. Set From: date to 01/01/2006 (earliest date available)
  7. Click the Search button
  8. Click the red Download Crime Data link
  9. Click the red Check all link
  10. Click the Get Data button
  11. Save the resulting file as wardX.csv in the data directory.

About

DC Crime Data by ward

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages