diff --git a/.Rbuildignore b/.Rbuildignore index b382cc6..7c7c548 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -2,4 +2,5 @@ ^\.Rproj\.user$ out R/deprecated.R$ -.travis.yml +^\.travis.yml$ +^\.github diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..f1d2220 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,40 @@ +# Run CI for R using https://eddelbuettel.github.io/r-ci/ + +name: ci + +on: + push: + pull_request: + +env: + USE_BSPM: "true" + _R_CHECK_FORCE_SUGGESTS_: "false" + +jobs: + ci: + strategy: + matrix: + include: + - {os: macOS-latest} + - {os: ubuntu-latest} + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Bootstrap + run: | + curl -OLs https://eddelbuettel.github.io/r-ci/run.sh + chmod 0755 run.sh + ./run.sh bootstrap + + - name: Dependencies + run: ./run.sh install_all + + - name: Test + run: ./run.sh run_tests + + #- name: Coverage + # if: ${{ matrix.os == 'ubuntu-latest' }} + # run: ./run.sh coverage diff --git a/DESCRIPTION b/DESCRIPTION index cfa4cff..45bf38b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,5 +13,7 @@ Depends: R (>= 2.10) LazyData: true Imports: utils, dplyr, seasonal, ggplot2, data.table, zoo, x13binary Suggests: knitr, rmarkdown +URL: https://github.com/eddelbuettel/gunsales +BugReports: https://github.com/eddelbuettel/gunsales/issues VignetteBuilder: knitr RoxygenNote: 5.0.1 diff --git a/README.md b/README.md index bd7f7b8..785a04c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # Analysis of NICS gun purchase background checks -[![Build Status](https://travis-ci.org/NYTimes/gunsales.svg)](https://travis-ci.org/NYTimes/gunsales) [![License](http://img.shields.io/badge/license-Apache%20%28=%202%29-brightgreen.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![CRAN](http://www.r-pkg.org/badges/version/gunsales)](https://cran.r-project.org/package=gunsales) [![Downloads](http://cranlogs.r-pkg.org/badges/gunsales?color=brightgreen)](http://www.r-pkg.org/pkg/gunsales) +[![Build Status](https://github.com/eddelbuettel/gunsales/actions/workflows/ci.yaml/badge.svg)](https://github.com/eddelbuettel/gunsales/actions/workflows/ci.yaml) +[![License](https://img.shields.io/badge/license-Apache%20%28=%202%29-brightgreen.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0) +[![CRAN](https://www.r-pkg.org/badges/version/gunsales)](https://cran.r-project.org/package=gunsales) +[![Downloads](https://cranlogs.r-pkg.org/badges/gunsales?color=brightgreen)](https://www.r-pkg.org/pkg/gunsales) 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](http://www.nytimes.com/interactive/2015/12/10/us/gun-sales-terrorism-obama-restrictions.html?). +Obama and Calls for Restrictions](https://www.nytimes.com/interactive/2015/12/10/us/gun-sales-terrorism-obama-restrictions.html?). ### Pre-requisites @@ -52,12 +55,12 @@ to create, respectively, plots via R base or ### Data issues -The source data comes from the [FBI's National Instant Criminal Background Check System](https://www.fbi.gov/about-us/cjis/nics), and was converted from the original [PDF format](https://www.fbi.gov/file-repository/nics_firearm_checks_-_month_year_by_state_type.pdf) to CSV using [Tabula](http://tabula.technology/). +The source data comes from the [FBI's National Instant Criminal Background Check System](https://www.fbi.gov/about-us/cjis/nics), and was converted from the original [PDF format](https://www.fbi.gov/file-repository/nics_firearm_checks_-_month_year_by_state_type.pdf) to CSV using [Tabula](https://tabula.technology/). BuzzFeed also released the same dataset on [Github](https://github.com/BuzzFeedNews/nics-firearm-background-checks/) last week. #### Getting gun sales estimates from background checks -To convert background checks into estimated sales, we relied on a method suggested in the [Small Arms Survey](http://www.smallarmssurvey.org/fileadmin/docs/F-Working-papers/SAS-WP14-US-Firearms-Industry.pdf) by Jurgen Brauer, a professor at Georgia Regents University. Each long gun and handgun check was counted as 1.1 sales. Each multiple-gun check was counted as two sales. Permit checks and other types of checks were omitted. The multiplier is an estimate based on Mr. Brauer's interviews with gun shop owners. +To convert background checks into estimated sales, we relied on a method suggested in the [Small Arms Survey](https://www.smallarmssurvey.org/fileadmin/docs/F-Working-papers/SAS-WP14-US-Firearms-Industry.pdf) by Jurgen Brauer, a professor at Georgia Regents University. Each long gun and handgun check was counted as 1.1 sales. Each multiple-gun check was counted as two sales. Permit checks and other types of checks were omitted. The multiplier is an estimate based on Mr. Brauer's interviews with gun shop owners. Note: In our computation, we excluded background checks for the "multiple" category in California because they followed an unusual pattern that did not match California gun sales data.