An analysis of US mass shootings between 1982 and 2019.
The output of this code is an html page which can be viewed on Rpubs.com
The reason this analysis was conducted was because:
- I wanted a project to help me to learn more about R
- someone posted a link to this data set on one of the Data Visualisation Society's Slack channels
- I was interested in what the data would tell me about mass shootings in the US
This analysis is based on data on US mass shootings 1982 - 2019 provided by Mother Jones:
“Our research focused on indiscriminate rampages in public places resulting in four or more victims killed by the attacker. We exclude shootings stemming from more conventionally motivated crimes such as armed robbery or gang violence.”
Data is available for download on motherjones.com
Analysis done using R in RStudio.
Results published to HTML using RMarkdown.
HTML styled using CSS.
HTML file is hosted on rpubs
- tidyverse
- operators
- magrittr
- dplyr
- knitr
- sf
- usmap
- waffle
- treemapify
- gganimate
- tweenr
- gifski
- png
- viridis
ggplot, gganimate, usmap, treemapify and waffle were used to create the data visualisations, which include:
- Map of US states
- Treemap
- A big ol' number
- Line graph with trend line and data labels
- Animated bar chart
- Static bar chart with data labels
- Lollipop chart with data labels inside the bubbles
- Proportional stacked bar chart
- Heatmap
- Faceted line graphs
- Waffle chart
- Diverging bar chart
- Scatter plot
- Tables