Forecasting Crime in Portland
Required packages: rvest
, data.table
, foreign
, zoo
, sp
, rgeos
, maptools
, rgdal
-
Run
data_download.R
to scrape the NIJ website for links to all .zip files and download them into./data
. -
Run
crimes_to_csv.R
to convert these shapefiles' .dbf databases into our analysis .csv files:crimes_all.csv
,crimes_bur.csv
,crimes_str.csv
andcrimes_veh.csv
. -
Make sure you have the provided
Portland_Police_Districts.shp
shapefile of police districts in Portland in./data
, then runextract_portland_boundary_to_csv.R
to create a text file containing all x-y coordinates of the (500-ft-buffered) vertices of the outer boundary of Portland into./data/portland_coords.csv
.
competition_output.R
takes all the parameters as input and outputs one shapefile (.shp, .dbf, .prj, and .shx) in the appropriate place in thesubmissions
folder (one crime type/horizon combination per run ofcompetition_output.R
).