Skip to content

A dashboard for visualization of crime rate from a dataset collected in the 1990s, including interactive map, data filtering, and factor analysis.

License

Notifications You must be signed in to change notification settings

UBC-MDS/Communites_and_Crime_group8

Repository files navigation

Crime Rate Finder App

Test app w/ {renv} shiny-deploy


Index

Welcome!

In this README you will find all the information you will need to set up, use and contribute to the Communities and Crime Dashboard. Please follow our Contributing Guidelines and be mindful of our Code of Conduct. Please enjoy and we hope this dashboard is of use on your projects!

Motivation

The crime rate in a community is an important factor that citizens consider when making decisions about whether to live or invest. A high crime rate in a city may impact personal safety, property values, and overall quality of life and is influenced by many factors. Understanding where, how and why crime happens is important for fighting and lowering crime rates, hence increasing safety in communities. Since 1930, the FBI has been collecting data on the types, amounts, and impact of crime in the United States through the Uniform Crime Reporting Program. So, our dashboard will aim to figure out the socioeconomic conditions, socio-demographic and community factors influencing crime rates in different US states as well as provide access to crime data in an understandable and intuitive manner.

Usage

The Crime Rate Finder App contains an interactive map as a landing page that will show the violent crimes committed in the Continental United States of America by State and County.

The top menu is used for overall navigation and will include a 'Data Exploration', 'Correlation' and 'Scatter' options:

  • 'Data Exploration' enables users to select "State" and "Community" to look at the crime rate at each community on a map, and users can also directly swipe and zoom the map to to refer the respective crime rate. When the user arrives at a data point and clicks on the marker a callout will indicate the Crime Rate in the Community. The user can also select from a Basemap, a Neighborhood Map and a Sattelite Map by using the menu on the top right of the map.

  • 'Correlation' aims to explore the correlation between community (selected using the provided dropdown box or typing a State name), composition and violent crimes in a given state (or the entire continental USA).

  • 'Scatter' aims to plot the relationship between crime rate and different variables that represent a community's composition. By selecting the option of "Communities in the State" the user can see a table that represents the data in the scatterplot for easy readability; this also displays a button the user can press to download the data contained in the table for further analysis.

  • 'More Information' gives the user useful links to the FBI Crime Report, FBI Crime Database and the main Wikipedia article on Crime in the United States

Sketch

Data Exploration

Map

Correlation

Correlation Plot

Scatter -> Scatterplot

Scatterplot

Scatter -> Communities by State

Table

More Information

Links

Running Locally

  1. Please follow the forking procedures here, including cloning the forked repository.

  2. Open app.R from the main repository folder.

  3. Make sure to have the necessary packages installed and up to date:

    • You can install missing packages by running the following command in the R console:
    install.packages(c("readr", "shiny", "bslib", "leaflet", "DT", "ggplot2", "plotly", "thematic", "ggcorrplot"))
    
  4. Open app.R from the main folder using R Studio and click Run App in the top right corner of the screen.

  1. If you are in the command line interface, you can use the following code to run the project
git clone https://github.com/UBC-MDS/Communites_and_Crime_group8.git

cd Communites_and_Crime_group8

RScript app.R

Contributing

Interested in contributing? Check out the contributing guidelines here. We would love to know what other datasets we can bring into our dashboard to make it more useful. Please also feel free to offer suggestions on other interactive options you'd like to see. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

Please refer to our license file here

Authors

  • Sarah Abdelazim
  • Daniel Merigo
  • Luke Yang
  • Chenyang Wang

Reference

The data set can be found here. For more information on US crime rates, you can visit the FBI Crime Report.