Skip to content

An analysis of US mass shootings data (1982 to 2019) provided by Mother Jones. Analysis done using R in RStudio, results published to HTML using RMarkdown, and styled using CSS.

Notifications You must be signed in to change notification settings

foxnic/US-Mass-Shootings-Analysis

Repository files navigation

Project Description

An analysis of US mass shootings between 1982 and 2019.

Output

The output of this code is an html page which can be viewed on Rpubs.com

Motivation

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

Data

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

Tools Used

Analysis done using R in RStudio.

Results published to HTML using RMarkdown.

HTML styled using CSS.

HTML file is hosted on rpubs

R Packages Used

  • tidyverse
  • operators
  • magrittr
  • dplyr
  • knitr
  • sf
  • usmap
  • waffle
  • treemapify
  • gganimate
  • tweenr
  • gifski
  • png
  • viridis

Visualisation Types

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

Useful Links

About

An analysis of US mass shootings data (1982 to 2019) provided by Mother Jones. Analysis done using R in RStudio, results published to HTML using RMarkdown, and styled using CSS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages