Package 'gunsales'

Title: Statistical Analysis of Monthly Background Checks of Gun Purchases
Description: Statistical analysis of monthly background checks of gun purchases for the New York Times story "What Drives Gun Sales: Terrorism, Obama and Calls for Restrictions" at <http://www.nytimes.com/interactive/2015/12/10/us/gun-sales-terrorism-obama-restrictions.html?> is provided.
Authors: Gregor Aisch, Josh Keller and Dirk Eddelbuettel
Maintainer: Dirk Eddelbuettel <[email protected]>
License: Apache License (== 2)
Version: 0.1.2
Built: 2024-12-09 04:29:35 UTC
Source: https://github.com/NYTimes/gunsales

Help Index


Source data from the FBI's National Instant Criminal Background Check System

Description

It was converted from the original PDF format to CSV using Tabula.

Format

A ‘tbl_df’ and data frame object with 11480 observation of 34 variables

Source

https://www.fbi.gov/file-repository/nics_firearm_checks_-_month_year_by_state_type.pdf

See Also

The GitHub repository created by Buzzfeed containing a similar data set at https://github.com/BuzzFeedNews/nics-firearm-background-checks/


Run Statistical Analysis of Monthly Background Checks of Gun Purchase

Description

Run Statistical Analysis of Monthly Background Checks of Gun Purchase

Usage

analysis(debug = FALSE)

Arguments

debug

Optional boolean switch to indicate whether interim data is displayed; default is ‘FALSE’

Value

A data.frame is returned, contained all different prepared columns.

Author(s)

Gregor Aisch and Josh Keller wrote the R code; Dirk Eddelbuettel created and maintains the package.

See Also

The NY Times article presenting this analsysi undertaken by this package is at http://www.nytimes.com/interactive/2015/12/10/us/gun-sales-terrorism-obama-restrictions.html?

Examples

## Not run: 
  gs <- analysis()
  plot_gunsales(gs)
  ggplot_gunsales(gs)

## End(Not run)

ggplot2 plots for gunsales analysis

Description

This function creates (ggplot2) plots for gunsales analysis.

Usage

ggplot_gunsales(df, savePlots = FALSE, savePNG = FALSE)

Arguments

df

A data.frame as prepared by the analysis functions.

savePlots

A boolean toggle to indicate if the plots are to be saved in the out/ directory as a single pdf file, with a default of FALSE.

savePNG

A boolean toggle to indicate if the plots are to be saved in the out/ directory as individual png files, with a default of FALSE.

Details

In interactive mode, plot display is paused and the user has to advance by pressing the Return key.

Value

NULL is returned invisibly.

Author(s)

Gregor Aisch and Josh Keller wrote the R code; Dirk Eddelbuettel created and maintains the package.

See Also

The NY Times article presenting this analsysi undertaken by this package is at http://www.nytimes.com/interactive/2015/12/10/us/gun-sales-terrorism-obama-restrictions.html?

Examples

## Not run: 
  gs <- analysis()
  ggplot_gunsales(gs)

## End(Not run)

Base Plots for gunsales analysis

Description

This function creates (base graphics) plots for gunsales analysis.

Usage

plot_gunsales(df, savePlots = FALSE)

Arguments

df

A data.frame as prepared by the analysis functions.

savePlots

A boolean toggle to indicate if the plots are to be saved in the out/ directory, with a default of FALSE.

Details

In interactive mode, plot display is paused and the user has to advance by pressing the Return key.

Value

NULL is returned invisibly.

Author(s)

Gregor Aisch and Josh Keller wrote the R code; Dirk Eddelbuettel created and maintains the package.

See Also

The NY Times article presenting this analsysi undertaken by this package is at http://www.nytimes.com/interactive/2015/12/10/us/gun-sales-terrorism-obama-restrictions.html?

Examples

## Not run: 
  gs <- analysis()
  plot_gunsales(gs)

## End(Not run)

US Population Growth data

Description

Montly observations about population growth

Format

A ‘tbl_df’ and data frame object with 217 observation of 3 variables

Source

US Census Bureau