About
These materials reproduce the findings from a journal paper published in Police Practice and Research which explored police deployment time in response to emergency calls for service using data from Detroit, United States.
Steps for reproduction in R
- Download or clone this GitHub repository to your local machine.
- Download the data files from the corresponding OSF repository and save them in the
data
folder1. - Open the
demand_viz.Rproj
project file. This will launch RStudio. - Package versions are managed by renv. Execute
renv::restore()
to install the required packages in the virtual environment. You might have to install lorenzgini manually from GitHub -- see comments within the scripts. - The two scripts in the scripts folder can be used to reproduce the paper's findings. Both scripts are almost identical: one for the raw counts/total deployment time, one for the time spent on scene2.
- Running these scripts will generate and save tables and figures in the
results
andvisuals
folders, respectively. - Render
results_summary.Rmd
to summarize these findings in a single document.
Contact
If you have any questions about running the scripts or the paper itself, please get in touch.
Footnotes
-
Since publication, the calls for service data used in the paper were removed from the Detroit Police Department open data portal and replaced with comparable -- but differently structured -- data files for individual years. Hence, the raw data used for analysis has been uploaded to OSF. For ease, the same has been done for the geo data. ↩
-
As evident in the commit history, minor changes were made to the code after publication to remedy new code errors caused by a lack of package versioning. Since then, renv has been used and it should avoid these problems going forward. ↩