Analysed the crime data provided by https://data.boston.gov/dataset/crime-incident-reports-august-2015-to-date-source-new-system. A crime density heat map was generated based on reported locations of crime. Geospatial data was built by layering crime incident location over map. Analysed the crime data grouped by district to see pct change in crime across two years. 2016-17 has 91561 variables. 2017-18 has 92041 variables.
plyr, ggmap, ggplot2, lubridate ; all downloadable from CRAN
R and R Studio
Data is available from the city of Boston data repositories. Crime incident reports are provided by Boston Police Department (BPD) to document the initial details surrounding an incident to which BPD officers respond. This is a dataset containing records from the new crime incident report system, which includes a reduced set of fields focused on capturing the type of incident as well as when and where it occurred. Records in the new system begin in June of 2015. Last Update of Dataset 02/04/2018 Data Provided under Open Data Commons Public Domain Dedication and License (PDDL).
Simple complete case matching is done to remove any empty variables. Data is split into two chunks 2016-17 and 2017-18.
Utilised the ggmap library to pull a roadmap from Google Maps. This was later overlaid with multiple grammar of graphics layers for density gradient and more.
The map shows the crime density in Boston for a period of one year from February 2017 to February 2018.
Barplot modeling using ggplot is done using the frequency of crimes committed. A material theme is applied to make it look nice. First we generate a plot for the 16-17 year
Then we do the same for the 17-18 year.
Now we can compare the percentage change between the two years and find out how much incidents of crime have changed
Will be working on a neural network to predict hotspots for the upcoming months. Will be interesting to see if that actually happens IRL.
This project is licensed under the MIT License - see the LICENSE.md file for details
-
R Core Team (2013). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL http://www.R-project.org/.
-
R Packages used : Plyr, ggmap, ggplot2, lubridate