Statistical Analysis of Monthly Background Checks of Gun Purchases

library(gunsales)

About

This document provides the analysis from the New York Times on-line article "What Drives Gun Sales: Terrorism, Obama and Calls for Restrictions". The R code underlying the analysis is provided in the GitHub repository gunsales which contains the R package

Part I Data

The first step consists in transforming the two raw data sets included in the package into the data.frame used for the subsequent plotting.

gunsales <- analysis()
if (gunsales:::.goodOS()) gunsales <- analysis() else cat("Unsupported platform -- no plots below.")

Part II: Base Plots

Given the transformed data, we can display the variety of plots contained in the New York Times analysis (which uses post-processed variants suitable for publication).

plot_gunsales(gunsales)
if (gunsales:::.goodOS()) plot_gunsales(gunsales)

Part III: Using ggplot

The second set of charts redisplays the same charts as before, but using the ggplot2 package.

ggplot_gunsales(gunsales)
if (gunsales:::.goodOS()) ggplot_gunsales(gunsales)


Try the gunsales package in your browser

Any scripts or data that you put into this service are public.

gunsales documentation built on May 2, 2019, 7:55 a.m.