Heatmap Plot of All Crimes (except Petty & Financial) in October 2018
Problem: Montgomery County, MD has an open data portal with large amounts of data locked away in tables which makes interpretation difficult.
Solution: Build a web application using R Shiny that allows users to explore the data through maps and other visualizations.
Results:
  • Released the application and the associated code
  • Participated in a focus group with the County government discussing ways the data could be improved.
Status: App Posted – Available on shinyapps.io
Skills Used: R Shiny; API Access; geospatial data; leaflet maps; kernel density estimation
Languages Used: R; HTML; CSS

When I first started learning R, I sought out various projects that I could work on to practice what I was learning through my online courses.  I found dataMontgomery, my county’s open data portal, while trying to find information related to rental housing. I didn’t find it, but I did find a dataset of crime reports that is updated daily that gave me an opportunity to practice skills that I was particularly interested in; data visualization, working with geospatial data, and accessing data through an API.

So I set to work on building this app. At first the map consisted solely of points and the frequency graphs in the upper-right. I was content with that. After all, for things like DUI, the data show a very clear (expected) pattern of arrests being heavier in the late night and early morning hours on the weekend. I found that very powerful.

Point Map Showing DUIs From January – October 2018

For months after that, this app became my sandbox for testing out new skills such as the heatmap created using kernel density estimation and the grid map which aggregates points within arbitrarily plotted squares.

Grid Map Showing Larceny Crimes for 1500m Squares from June – October 2018

This app was my final project in the Coursera Data Science Specialization Developing Data Products course. I have also shared this application with the people who run dataMontgomery and was asked to participate in a focus group about how the data could be improved. I advised them, for example, that for several hundred of their points, the latitude and longitude were reversed. Also, that they should offer a data field that labels the crimes committed at a higher level of aggregation (e.g., “larceny” instead of “larceny – shoplifting”). They made both of these changes.

I have since demonstrated this app during several presentations I’ve given on the capabilities of R Shiny and on Leaflet maps.

Leave a Reply

Your email address will not be published. Required fields are marked *