Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.

Original


Source: NICS Firearm Background Checks (2020).


Objective

The objective of the visualization is to compare both Republican and Democratic Presidential Terms and their respective attitudes to gun control by referencing the number of NICS firearm background checks carried out by the FBI during each of those presidential terms.

The target audience is the voting American public.

The visualisation chosen had the following three main issues:

  • Poor question - The primary question is not clear and could be conceived in a number of different ways from this visualization:
    • Are the presidential overlays simply there out of interest and the purpose is to examine firearm background checks over time?
    • Is the primary purpose to compare the Republican & Democratic Parties and how they performed with respect to firearm background checks?
    • Is the primary purpose to compare Presidential Terms and how the presidents performed with respect to firearm background checks
  • Deceptive - a single glance at the green spike at the end in Trumps presidential term infers that Trump is a strong advocate for gun control based on the high number of firearm background checks, and has instigated strong policies to enforce gun control. Media reports, particularly in recent times would suggest this is not the case. Fake News?
    • The visualisation does not correlate any additional data with the spikes leaving the viewer to draw whatever conclusions suit them rather than provide any answers. As such, can be construed in a variety of ways or misconstrued to suit an agenda.
  • Poor visuals - There are no keys, leaving the following questions unanswered.
    • What do the red and blue presidents names mean? Do they refer to a political party?
    • What are the grey dots? Do they refer to monthly firearm background checks?
    • What is that green line? Is it a moving average? How is it calculated?
    • What is that dotted line? Is it some sort of trend line?

Reference



Code

The following code was used to fix the issues identified in the original.

# Import the required libraries
library(ggplot2)
library(lubridate)
library(stringr)

# Read in the NICS Firearm Background Checks data
nics_df <- read.csv('nics.csv', header = TRUE)

# Create a vector of presidential terms
terms <- c('Bush\n(Term 1)', 'Bush\n(Term 2)', 'Obama\n(Term 1)', 'Obama\n(Term 2)', 'Trump\n(Term 1)')

# Create a vector of presidential party affiliations
parties <- c('Republican', 'Republican', 'Democratic', 'Democratic', 'Republican')

# Subset the dataframe to the required columns
nics_df_sub <- nics_df[c('month', 'totals')]

# Convert the month column from a factor to a date type
nics_df_sub$month <- str_c(nics_df_sub$month, '-01')
nics_df_sub$month <- ymd(nics_df_sub$month)

# Find the median firearm background checks for each presidential term:
# Bush - Term 1
bt1 <- as.integer(median(nics_df_sub[nics_df_sub$month >= "2001-02-01" & nics_df_sub$month < "2005-02-01", "totals"], na.rm = TRUE))
# Bush - Term 2
bt2 <- as.integer(median(nics_df_sub[nics_df_sub$month >= "2005-02-01" & nics_df_sub$month < "2009-02-01", "totals"], na.rm = TRUE))
# Obama - Term 1
ot1 <- as.integer(median(nics_df_sub[nics_df_sub$month >= "2009-02-01" & nics_df_sub$month < "2013-02-01", "totals"], na.rm = TRUE))
# Obama - Term 2
ot2 <- as.integer(median(nics_df_sub[nics_df_sub$month >= "2013-02-01" & nics_df_sub$month < "2017-02-01", "totals"], na.rm = TRUE))
# Trump - Term 1
tt1 <- as.integer(median(nics_df_sub[nics_df_sub$month >= "2017-02-01" & nics_df_sub$month < "2021-02-01", "totals"], na.rm = TRUE))

# Create a vector of median firearm background checks for each presidential term
checks <- c(bt1, bt2, ot1, ot2, tt1)

# Create final dataframe required for the visualisation
df <- data.frame(term = terms, check = checks)

# Create the plot
p1 <- ggplot(df, aes(x = term, y = check, fill = parties)) + geom_bar(stat = "identity", width = 0.5) + scale_fill_manual("US Political Parties", values = c("Republican" = "tomato3", "Democratic" = "royalblue4")) + labs(title = "Presidential Terms v FBI Firearm Background Checks", caption = "\nSource: NICS Firearm Background Checks by month. (2020). \n https//www.kaggle.com/pedropereira94/nics-firearm-background-checks", y = "Median Monthly Background Checks", x = "Presidential Term") + theme_minimal() + theme(axis.title.x = element_text(vjust = -2), axis.title.y = element_text(margin = margin(t = 0, r = 20, b = 0, l = 0))) 

Data Reference

  • NICS Firearm Background Checks by month. (2020). NICS Firearm Background checks. Monthly data collected by the FBI on firearm background checks. Retrieved August 23, 2020, from Kaggle.com website: https//www.kaggle.com/pedropereira94/nics-firearm-background-checks

  • Coleman, D. (2020). Presidential Inauguration Dates, Washington to Trump. Retrieved September 4, 2020, from History in Pieces Website: https://historyinpieces.com/research/presidential-inauguration-dates



Reconstruction

The following plot fixes the main issues in the original.