Help for package gunsales (original) (raw)
| Type: | Package |
|---|---|
| Title: | Statistical Analysis of Monthly Background Checks of Gun Purchases |
| Version: | 0.1.2 |
| Date: | 2017-01-30 |
| Author: | Gregor Aisch, Josh Keller and Dirk Eddelbuettel |
| Maintainer: | Dirk Eddelbuettel edd@debian.org |
| 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. |
| License: | Apache License (== 2) |
| Depends: | R (≥ 2.10) |
| LazyData: | true |
| Imports: | utils, dplyr, seasonal, ggplot2, data.table, zoo, x13binary |
| Suggests: | knitr, rmarkdown |
| VignetteBuilder: | knitr |
| RoxygenNote: | 5.0.1 |
| NeedsCompilation: | no |
| Packaged: | 2017-01-30 12:57:39.58986 UTC; edd |
| Repository: | CRAN |
| Date/Publication: | 2017-01-30 15:35:35 |
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 theanalysis 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 athttp://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 theanalysis functions. |
|---|---|
| savePlots | A boolean toggle to indicate if the plots are to be saved in the out/ directory, with a default ofFALSE. |
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 athttp://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