├── .github ├── .gitignore └── workflows │ └── pkgdown.yaml ├── .travis.yml ├── NAMESPACE ├── .DS_Store ├── .gitignore ├── man ├── .DS_Store ├── figures │ ├── logo.png │ ├── .DS_Store │ └── ttbbeer-logo.png ├── ttbbeer.Rd ├── spirittax.Rd ├── winetax14.Rd ├── winetax1421.Rd ├── winetax2124.Rd ├── champagnetax.Rd ├── artificialcarbontax.Rd ├── beertax.Rd ├── tobaccotax.Rd └── beermaterials.Rd ├── data ├── beertax.rda ├── spirittax.rda ├── winetax14.rda ├── tobaccotax.rda ├── winetax1421.rda ├── winetax2124.rda ├── beermaterials.rda ├── champagnetax.rda └── artificialcarbontax.rda ├── pkgdown └── favicon │ ├── favicon.ico │ ├── favicon-96x96.png │ ├── apple-touch-icon.png │ ├── web-app-manifest-192x192.png │ ├── web-app-manifest-512x512.png │ ├── site.webmanifest │ └── favicon.svg ├── R ├── globalVariables.R ├── ttbbeer.R ├── spirittax.R ├── winetax14.R ├── winetax1421.R ├── winetax2124.R ├── champagnetax.R ├── artificialcarbontax.R ├── beertax.R ├── tobaccotax.R └── beermaterials.R ├── NEWS.md ├── ttbbeer.Rproj ├── .Rbuildignore ├── _pkgdown.yml ├── DESCRIPTION ├── CONDUCT.md ├── cran-comments.md ├── README.md └── data-raw └── get_data_process.R /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: R 2 | cache: packages 3 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | docs 6 | -------------------------------------------------------------------------------- /man/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/man/.DS_Store -------------------------------------------------------------------------------- /data/beertax.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/beertax.rda -------------------------------------------------------------------------------- /data/spirittax.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/spirittax.rda -------------------------------------------------------------------------------- /data/winetax14.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/winetax14.rda -------------------------------------------------------------------------------- /data/tobaccotax.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/tobaccotax.rda -------------------------------------------------------------------------------- /data/winetax1421.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/winetax1421.rda -------------------------------------------------------------------------------- /data/winetax2124.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/winetax2124.rda -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/man/figures/logo.png -------------------------------------------------------------------------------- /data/beermaterials.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/beermaterials.rda -------------------------------------------------------------------------------- /data/champagnetax.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/champagnetax.rda -------------------------------------------------------------------------------- /man/figures/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/man/figures/.DS_Store -------------------------------------------------------------------------------- /data/artificialcarbontax.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/data/artificialcarbontax.rda -------------------------------------------------------------------------------- /man/figures/ttbbeer-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/man/figures/ttbbeer-logo.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/pkgdown/favicon/favicon-96x96.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/web-app-manifest-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/pkgdown/favicon/web-app-manifest-192x192.png -------------------------------------------------------------------------------- /pkgdown/favicon/web-app-manifest-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasdumas/ttbbeer/HEAD/pkgdown/favicon/web-app-manifest-512x512.png -------------------------------------------------------------------------------- /R/globalVariables.R: -------------------------------------------------------------------------------- 1 | globalVariables(c("beermaterials", "spirittax", 2 | "winetax14", "winetax1421", 3 | "winetax2124", "champagnetax", 4 | "artificialcarbontax", "beertax", 5 | "tobaccotax")) 6 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # ttbbeer 1.1.0 2 | 3 | * 2016-07-10: 8 additional datasets for historical tax rates have been added. bump major revision. 4 | 5 | * 2016-07-10: updated documentation for the package. 6 | 7 | # ttbbeer 1.0.0 8 | 9 | * 2016-07-03: now on CRAN [https://cran.r-project.org/package=ttbbeer](https://cran.r-project.org/package=ttbbeer) 10 | 11 | * 2016-07-02: initial upload to github repository with plans to submit to CRAN soon 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ttbbeer.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | ProjectId: da91d89c-c7b2-4e4a-94fb-736f0bcc97bb 3 | 4 | RestoreWorkspace: Default 5 | SaveWorkspace: Default 6 | AlwaysSaveHistory: Default 7 | 8 | EnableCodeIndexing: Yes 9 | UseSpacesForTab: Yes 10 | NumSpacesForTab: 2 11 | Encoding: UTF-8 12 | 13 | RnwWeave: knitr 14 | LaTeX: pdfLaTeX 15 | 16 | AutoAppendNewline: Yes 17 | StripTrailingWhitespace: Yes 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | -------------------------------------------------------------------------------- /pkgdown/favicon/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "/web-app-manifest-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png", 9 | "purpose": "maskable" 10 | }, 11 | { 12 | "src": "/web-app-manifest-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png", 15 | "purpose": "maskable" 16 | } 17 | ], 18 | "theme_color": "#ffffff", 19 | "background_color": "#ffffff", 20 | "display": "standalone" 21 | } -------------------------------------------------------------------------------- /R/ttbbeer.R: -------------------------------------------------------------------------------- 1 | #' ttbbeer: A package for US Brewery data sets. 2 | #' @description The ttbbeer package includes at current state, one data set of 3 | #' a collection of 10 years (2006 - 2015) worth of data on materials 4 | #' used at U.S. breweries in pounds reported by the Brewer's Report 5 | #' of Operations and the Quarterly Brewer's Report of Operations 6 | #' forms, ready for data analysis. 7 | #' @section ttbbeer functions: 8 | #' The ttbbeer functions include data("beermaterials"). 9 | #' 10 | #' @docType package 11 | #' @name ttbbeer 12 | NULL 13 | -------------------------------------------------------------------------------- /R/spirittax.R: -------------------------------------------------------------------------------- 1 | #' The spirittax dataset 2 | #' @description This dataset contains a list of historical tax rates for 3 | #' distilled spirits per proof gallon from TTB. 4 | #' @source \url{http://catalog.data.gov/dataset/historical-tax-rates} 5 | #' @format A data frame with 15 observations of 3 variables: 6 | #' \describe{ 7 | #' \item{FROM}{FROM, date of starting tax rate} 8 | #' \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 9 | #' \item{RATE}{RATE, in dollars} 10 | #' } 11 | "spirittax" 12 | -------------------------------------------------------------------------------- /R/winetax14.R: -------------------------------------------------------------------------------- 1 | #' The winetax14 dataset 2 | #' @description This dataset contains a list of historical tax rates for wine 3 | #' not over 14% ABV per wine gallon from TTB. 4 | #' @source \url{http://catalog.data.gov/dataset/historical-tax-rates} 5 | #' @format A data frame with 11 observations of 3 variables: 6 | #' \describe{ 7 | #' \item{FROM}{FROM, date of starting tax rate} 8 | #' \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 9 | #' \item{RATE}{RATE, in dollars} 10 | #' } 11 | "winetax14" 12 | -------------------------------------------------------------------------------- /R/winetax1421.R: -------------------------------------------------------------------------------- 1 | #' The winetax1421 dataset 2 | #' @description This dataset contains a list of historical tax rates for 3 | #' wine 14 - 21% ABV per wine gallon from TTB. 4 | #' @source \url{http://catalog.data.gov/dataset/historical-tax-rates} 5 | #' @format A data frame with 11 observations of 3 variables: 6 | #' \describe{ 7 | #' \item{FROM}{FROM, date of starting tax rate} 8 | #' \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 9 | #' \item{RATE}{RATE, in dollars} 10 | #' } 11 | "winetax1421" 12 | -------------------------------------------------------------------------------- /R/winetax2124.R: -------------------------------------------------------------------------------- 1 | #' The winetax2124 dataset 2 | #' @description This dataset contains a list of historical tax rates for wine 3 | #' 21 - 24% ABV per wine gallon from TTB. 4 | #' @source \url{http://catalog.data.gov/dataset/historical-tax-rates} 5 | #' @format A data frame with 11 observations of 3 variables: 6 | #' \describe{ 7 | #' \item{FROM}{FROM, date of starting tax rate} 8 | #' \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 9 | #' \item{RATE}{RATE, in dollars} 10 | #' } 11 | "winetax2124" 12 | -------------------------------------------------------------------------------- /R/champagnetax.R: -------------------------------------------------------------------------------- 1 | #' The champagnetax dataset 2 | #' @description This dataset contains a list of historical tax rates for 3 | #' champagne or sparkling wine per wine gallon from TTB. 4 | #' @source \url{http://catalog.data.gov/dataset/historical-tax-rates} 5 | #' @format A data frame with 10 observations of 3 variables: 6 | #' \describe{ 7 | #' \item{FROM}{FROM, date of starting tax rate} 8 | #' \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 9 | #' \item{RATE}{RATE, in dollars} 10 | #' } 11 | "champagnetax" 12 | -------------------------------------------------------------------------------- /R/artificialcarbontax.R: -------------------------------------------------------------------------------- 1 | #' The artificialcarbontax dataset 2 | #' @description This dataset contains a list of historical tax rates for 3 | #' artificial carbon per wine gallon from TTB. 4 | #' @source \url{http://catalog.data.gov/dataset/historical-tax-rates} 5 | #' @format A data frame with 10 observations of 3 variables: 6 | #' \describe{ 7 | #' \item{FROM}{FROM, date of starting tax rate} 8 | #' \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 9 | #' \item{RATE}{RATE, in dollars} 10 | #' } 11 | "artificialcarbontax" 12 | -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ # Automatically added by RStudio, 2 | ^\.Rproj\.user$ # used for temporary files. 3 | ^ttbbeer\.Rproj$ # specific project file 4 | ^README\.Rmd$ # An Rmarkdown file used to generate README.md 5 | ^cran-comments\.md$ # Comments for CRAN submission 6 | ^\.travis\.yml$ # Used for continuous integration testing with travis 7 | ^CONDUCT\.md$ # Code of conduct for participating 8 | ^CONDUCT\.md$ 9 | ^cran-comments\.md$ 10 | ^ttbbeer\.Rproj$ 11 | ^\.travis\.yml$ 12 | ^get_data_process\.R$ 13 | ^data-raw$ 14 | ^_pkgdown\.yml$ 15 | ^docs$ 16 | ^pkgdown$ 17 | ^\.github$ 18 | -------------------------------------------------------------------------------- /R/beertax.R: -------------------------------------------------------------------------------- 1 | #' The beertax dataset 2 | #' @description This dataset contains a list of historical tax rates for 3 | #' beer per 31 gallon Bbl. from TTB. 4 | #' @source \url{http://catalog.data.gov/dataset/historical-tax-rates} 5 | #' @format A data frame with 10 observations of 3 variables: 6 | #' \describe{ 7 | #' \item{FROM}{FROM, date of starting tax rate. The first date does not have a listed day, so 09/01/1862 is used.} 8 | #' \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 9 | #' \item{RATE}{RATE, in dollars. The last two entries are originally '$9/$7' and '$18/$' respectively.} 10 | #' } 11 | "beertax" 12 | -------------------------------------------------------------------------------- /man/ttbbeer.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ttbbeer.R 3 | \docType{package} 4 | \name{ttbbeer} 5 | \alias{ttbbeer} 6 | \alias{ttbbeer-package} 7 | \title{ttbbeer: A package for US Brewery data sets.} 8 | \description{ 9 | The ttbbeer package includes at current state, one data set of 10 | a collection of 10 years (2006 - 2015) worth of data on materials 11 | used at U.S. breweries in pounds reported by the Brewer's Report 12 | of Operations and the Quarterly Brewer's Report of Operations 13 | forms, ready for data analysis. 14 | } 15 | \section{ttbbeer functions}{ 16 | 17 | The ttbbeer functions include data("beermaterials"). 18 | } 19 | 20 | -------------------------------------------------------------------------------- /man/spirittax.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/spirittax.R 3 | \docType{data} 4 | \name{spirittax} 5 | \alias{spirittax} 6 | \title{The spirittax dataset} 7 | \format{A data frame with 15 observations of 3 variables: 8 | \describe{ 9 | \item{FROM}{FROM, date of starting tax rate} 10 | \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 11 | \item{RATE}{RATE, in dollars} 12 | }} 13 | \source{ 14 | \url{http://catalog.data.gov/dataset/historical-tax-rates} 15 | } 16 | \usage{ 17 | spirittax 18 | } 19 | \description{ 20 | This dataset contains a list of historical tax rates for 21 | distilled spirits per proof gallon from TTB. 22 | } 23 | \keyword{datasets} 24 | 25 | -------------------------------------------------------------------------------- /man/winetax14.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/winetax14.R 3 | \docType{data} 4 | \name{winetax14} 5 | \alias{winetax14} 6 | \title{The winetax14 dataset} 7 | \format{A data frame with 11 observations of 3 variables: 8 | \describe{ 9 | \item{FROM}{FROM, date of starting tax rate} 10 | \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 11 | \item{RATE}{RATE, in dollars} 12 | }} 13 | \source{ 14 | \url{http://catalog.data.gov/dataset/historical-tax-rates} 15 | } 16 | \usage{ 17 | winetax14 18 | } 19 | \description{ 20 | This dataset contains a list of historical tax rates for wine 21 | not over 14% ABV per wine gallon from TTB. 22 | } 23 | \keyword{datasets} 24 | 25 | -------------------------------------------------------------------------------- /man/winetax1421.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/winetax1421.R 3 | \docType{data} 4 | \name{winetax1421} 5 | \alias{winetax1421} 6 | \title{The winetax1421 dataset} 7 | \format{A data frame with 11 observations of 3 variables: 8 | \describe{ 9 | \item{FROM}{FROM, date of starting tax rate} 10 | \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 11 | \item{RATE}{RATE, in dollars} 12 | }} 13 | \source{ 14 | \url{http://catalog.data.gov/dataset/historical-tax-rates} 15 | } 16 | \usage{ 17 | winetax1421 18 | } 19 | \description{ 20 | This dataset contains a list of historical tax rates for 21 | wine 14 - 21% ABV per wine gallon from TTB. 22 | } 23 | \keyword{datasets} 24 | 25 | -------------------------------------------------------------------------------- /man/winetax2124.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/winetax2124.R 3 | \docType{data} 4 | \name{winetax2124} 5 | \alias{winetax2124} 6 | \title{The winetax2124 dataset} 7 | \format{A data frame with 11 observations of 3 variables: 8 | \describe{ 9 | \item{FROM}{FROM, date of starting tax rate} 10 | \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 11 | \item{RATE}{RATE, in dollars} 12 | }} 13 | \source{ 14 | \url{http://catalog.data.gov/dataset/historical-tax-rates} 15 | } 16 | \usage{ 17 | winetax2124 18 | } 19 | \description{ 20 | This dataset contains a list of historical tax rates for wine 21 | 21 - 24% ABV per wine gallon from TTB. 22 | } 23 | \keyword{datasets} 24 | 25 | -------------------------------------------------------------------------------- /man/champagnetax.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/champagnetax.R 3 | \docType{data} 4 | \name{champagnetax} 5 | \alias{champagnetax} 6 | \title{The champagnetax dataset} 7 | \format{A data frame with 10 observations of 3 variables: 8 | \describe{ 9 | \item{FROM}{FROM, date of starting tax rate} 10 | \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 11 | \item{RATE}{RATE, in dollars} 12 | }} 13 | \source{ 14 | \url{http://catalog.data.gov/dataset/historical-tax-rates} 15 | } 16 | \usage{ 17 | champagnetax 18 | } 19 | \description{ 20 | This dataset contains a list of historical tax rates for 21 | champagne or sparkling wine per wine gallon from TTB. 22 | } 23 | \keyword{datasets} 24 | 25 | -------------------------------------------------------------------------------- /R/tobaccotax.R: -------------------------------------------------------------------------------- 1 | #' The tobaccotax dataset 2 | #' @description This dataset contains a list of historical tax rates for 3 | #' tobacco and tobacco products from TTB. 4 | #' @source \url{http://catalog.data.gov/dataset/historical-tax-rates} 5 | #' @format A data frame with 46 observations of 3 variables: 6 | #' \describe{ 7 | #' \item{ITEM}{ITEM, specific tobacco-based product.} 8 | #' \item{FROM}{FROM, date of starting tax rate. The first date does not have a listed day, so 09/01/1862 is used.} 9 | #' \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 10 | #' \item{RATE}{RATE, in dollars. Small cigarettes through Large cigars are per thousand. Chewing tobacco through Roll your own are per pound. Cigarette papers and tubes are per 50.} 11 | #' } 12 | "tobaccotax" 13 | -------------------------------------------------------------------------------- /man/artificialcarbontax.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/artificialcarbontax.R 3 | \docType{data} 4 | \name{artificialcarbontax} 5 | \alias{artificialcarbontax} 6 | \title{The artificialcarbontax dataset} 7 | \format{A data frame with 10 observations of 3 variables: 8 | \describe{ 9 | \item{FROM}{FROM, date of starting tax rate} 10 | \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 11 | \item{RATE}{RATE, in dollars} 12 | }} 13 | \source{ 14 | \url{http://catalog.data.gov/dataset/historical-tax-rates} 15 | } 16 | \usage{ 17 | artificialcarbontax 18 | } 19 | \description{ 20 | This dataset contains a list of historical tax rates for 21 | artificial carbon per wine gallon from TTB. 22 | } 23 | \keyword{datasets} 24 | 25 | -------------------------------------------------------------------------------- /man/beertax.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/beertax.R 3 | \docType{data} 4 | \name{beertax} 5 | \alias{beertax} 6 | \title{The beertax dataset} 7 | \format{A data frame with 10 observations of 3 variables: 8 | \describe{ 9 | \item{FROM}{FROM, date of starting tax rate. The first date does not have a listed day, so 09/01/1862 is used.} 10 | \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 11 | \item{RATE}{RATE, in dollars. The last two entries are originally '$9/$7' and '$18/$' respectively.} 12 | }} 13 | \source{ 14 | \url{http://catalog.data.gov/dataset/historical-tax-rates} 15 | } 16 | \usage{ 17 | beertax 18 | } 19 | \description{ 20 | This dataset contains a list of historical tax rates for 21 | beer per 31 gallon Bbl. from TTB. 22 | } 23 | \keyword{datasets} 24 | 25 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: http://jasminedaly.com/ttbbeer/ 2 | 3 | home: 4 | title: US Beer Statistics from TTB 5 | 6 | authors: 7 | Jasmine Daly: 8 | href: https://www.dalyanalytics.com/ 9 | 10 | template: 11 | bootstrap: 5 12 | light-switch: true 13 | bootswatch: cosmo # (Optional) Choose a theme 14 | includes: 15 | before_body: | 16 | 21 | 22 | bslib: 23 | base_font: {google: "Manrope"} 24 | heading_font: {google: "Frank Ruhl Libre"} 25 | code_font: {google: "JetBrains Mono"} 26 | 27 | 28 | -------------------------------------------------------------------------------- /man/tobaccotax.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tobaccotax.R 3 | \docType{data} 4 | \name{tobaccotax} 5 | \alias{tobaccotax} 6 | \title{The tobaccotax dataset} 7 | \format{A data frame with 46 observations of 3 variables: 8 | \describe{ 9 | \item{ITEM}{ITEM, specific tobacco-based product.} 10 | \item{FROM}{FROM, date of starting tax rate. The first date does not have a listed day, so 09/01/1862 is used.} 11 | \item{TO}{TO, date of ending tax rate. The last row is considered the present day rate indicated by the package creation date.} 12 | \item{RATE}{RATE, in dollars. Small cigarettes through Large cigars are per thousand. Chewing tobacco through Roll your own are per pound. Cigarette papers and tubes are per 50.} 13 | }} 14 | \source{ 15 | \url{http://catalog.data.gov/dataset/historical-tax-rates} 16 | } 17 | \usage{ 18 | tobaccotax 19 | } 20 | \description{ 21 | This dataset contains a list of historical tax rates for 22 | tobacco and tobacco products from TTB. 23 | } 24 | \keyword{datasets} 25 | 26 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: ttbbeer 2 | Type: Package 3 | Title: US Beer Statistics from TTB 4 | Version: 1.1.0 5 | Authors@R: person("Jasmine", "Daly", email = "jasmine.dumas@gmail.com", role = c("aut", "cre")) 6 | Description: U.S. Department of the Treasury, Alcohol and Tobacco Tax and 7 | Trade Bureau (TTB) collects data and reports on monthly beer 8 | industry production and operations. This data package includes 9 | a collection of 10 years (2006 - 2015) worth of data on materials 10 | used at U.S. breweries in pounds reported by the Brewer's Report 11 | of Operations and the Quarterly Brewer's Report of Operations 12 | forms, ready for data analysis. This package also includes historical 13 | tax rates on distilled spirits, wine, beer, champagne, and tobacco 14 | products as individual data sets. 15 | URL: https://github.com/jasdumas/ttbbeer, http://jasminedaly.com/ttbbeer/ 16 | BugReports: https://github.com/jasdumas/ttbbeer/issues 17 | Depends: 18 | R (>= 3.1.2) 19 | License: CC0 20 | LazyData: TRUE 21 | RoxygenNote: 5.0.1 22 | -------------------------------------------------------------------------------- /R/beermaterials.R: -------------------------------------------------------------------------------- 1 | #' The beermaterials dataset 2 | #' @description The monthly aggregation of materials used in US Breweries as reported by the TTB. 3 | #' The dataset was transcribed from PDF's to a .rda dataset. 4 | #' @source \url{https://catalog.data.gov/dataset/beer-production-and-operations-reports} 5 | #' @format A data frame with 120 observations of 11 variables: 6 | #' \describe{ 7 | #' \item{Month}{Month of the year} 8 | #' \item{Year}{Calendar Year} 9 | #' \item{Malt_and_malt_products}{Malt and malt products, in pounds} 10 | #' \item{Corn_and _corn_products}{Corn and corn products, in pounds} 11 | #' \item{Rice_and_rice_products}{Rice and rice products, in pounds} 12 | #' \item{Barley_and_barley_products}{Barley and barley products, in pounds} 13 | #' \item{Wheat_and_wheat_products}{Wheat and wheat products} 14 | #' \item{Sugar_and_syrups}{Sugar and syrups, in pounds} 15 | #' \item{Hops_dry}{Hops in dry form, in pounds} 16 | #' \item{Hops_extracts}{Hops in extracted form, in pounds} 17 | #' \item{Other}{Other materials such as flavor, in pounds} 18 | #' } 19 | "beermaterials" 20 | -------------------------------------------------------------------------------- /man/beermaterials.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/beermaterials.R 3 | \docType{data} 4 | \name{beermaterials} 5 | \alias{beermaterials} 6 | \title{The beermaterials dataset} 7 | \format{A data frame with 120 observations of 11 variables: 8 | \describe{ 9 | \item{Month}{Month of the year} 10 | \item{Year}{Calendar Year} 11 | \item{Malt_and_malt_products}{Malt and malt products, in pounds} 12 | \item{Corn_and _corn_products}{Corn and corn products, in pounds} 13 | \item{Rice_and_rice_products}{Rice and rice products, in pounds} 14 | \item{Barley_and_barley_products}{Barley and barley products, in pounds} 15 | \item{Wheat_and_wheat_products}{Wheat and wheat products} 16 | \item{Sugar_and_syrups}{Sugar and syrups, in pounds} 17 | \item{Hops_dry}{Hops in dry form, in pounds} 18 | \item{Hops_extracts}{Hops in extracted form, in pounds} 19 | \item{Other}{Other materials such as flavor, in pounds} 20 | }} 21 | \source{ 22 | \url{https://catalog.data.gov/dataset/beer-production-and-operations-reports} 23 | } 24 | \usage{ 25 | beermaterials 26 | } 27 | \description{ 28 | The monthly aggregation of materials used in US Breweries as reported by the TTB. 29 | The dataset was transcribed from PDF's to a .rda dataset. 30 | } 31 | \keyword{datasets} 32 | 33 | -------------------------------------------------------------------------------- /CONDUCT.md: -------------------------------------------------------------------------------- 1 | Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 4 | 5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. 6 | 7 | Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. 8 | 9 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. 10 | 11 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. 12 | 13 | This Code of Conduct is adapted from the Contributor Covenant, version 1.0.0, available from http://contributor-covenant.org/version/1/0/0/ 14 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | release: 8 | types: [published] 9 | workflow_dispatch: 10 | 11 | name: pkgdown.yaml 12 | 13 | permissions: read-all 14 | 15 | jobs: 16 | pkgdown: 17 | runs-on: ubuntu-latest 18 | # Only restrict concurrency for non-PR jobs 19 | concurrency: 20 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 21 | env: 22 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 23 | permissions: 24 | contents: write 25 | steps: 26 | - uses: actions/checkout@v4 27 | 28 | - uses: r-lib/actions/setup-pandoc@v2 29 | 30 | - uses: r-lib/actions/setup-r@v2 31 | with: 32 | use-public-rspm: true 33 | 34 | - uses: r-lib/actions/setup-r-dependencies@v2 35 | with: 36 | extra-packages: any::pkgdown, local::. 37 | needs: website 38 | 39 | - name: Build site 40 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 41 | shell: Rscript {0} 42 | 43 | - name: Deploy to GitHub pages 🚀 44 | if: github.event_name != 'pull_request' 45 | uses: JamesIves/github-pages-deploy-action@v4.5.0 46 | with: 47 | clean: false 48 | branch: gh-pages 49 | folder: docs 50 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | # cran-comments.md 2 | 3 | # ttbeer 1.1.0 4 | 5 | ## Test environments 6 | * local Mac OS install, R 3.3.1 7 | * ubuntu 12.04 (on travis-ci), R 3.1.2 8 | * win-builder via devtools::build_win() 9 | 10 | ## R CMD check results 11 | There were no ERRORs, WARNINGs or NOTEs. 12 | R CMD check results 13 | 0 errors | 0 warnings | 0 notes 14 | R CMD check succeeded 15 | 16 | Additional Comments: 17 | * TTB is not a misspelling but an acronym. 18 | 19 | ## Release Commentary 20 | 21 | * 2016-07-10: Eight new data sets have been added to this package and the documentation has been updated. 22 | 23 | ______ 24 | 25 | # ttbeer 1.0.0 26 | 27 | ## Test environments 28 | * local Mac OS install, R 3.3.1 29 | * ubuntu 12.04 (on travis-ci), R 3.1.2 30 | * win-builder via devtools::build_win() 31 | 32 | ## R CMD check results 33 | There were no ERRORs or WARNINGs. 34 | 35 | 0 errors | 0 warnings | 1 notes 36 | 37 | There was 1 NOTE: 38 | 39 | * This is my first submission to CRAN so one note may arise from that. Everything else has been satisfied and no other NOTEs appear. 40 | 41 | Additional Comments: 42 | * TTB is not a misspelling but an acronym. 43 | * The URL and BugReports links to the github repository. 44 | 45 | ## Release Commentary 46 | 47 | * 2016-07-03: Per reviewer feedback I'm am providing a different and valid link in the source section of the beermaterials.R as the original link produced errors and certificate authencity. This new link actually supports the motivation for this data package as the page says the data is in HTML format when in fact the data is in PDF format. I have also reported a data issue to the data.gov site and requested the correct format be specified on the site to eliminate confusion. 48 | 49 | 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ttbbeer 2 | 3 | 4 | 5 | 6 | [![CRAN status](https://www.r-pkg.org/badges/version/ttbbeer)](https://CRAN.R-project.org/package=ttbbeer) 7 | [![Downloads](https://cranlogs.r-pkg.org/badges/ttbbeer)](https://cran.r-project.org/package=ttbbeer) 8 | [![Total Downloads](https://cranlogs.r-pkg.org/badges/grand-total/ttbbeer)](https://cran.r-project.org/package=ttbbeer) 9 | 10 | 11 | ### An R data package of beer statistics from U.S. Department of the Treasury, Alcohol and Tobacco Tax and Trade Bureau (TTB) 12 | 13 | This package provides the **one** data set for materials used at U.S. breweries as listed in the [Beer Monthly Statistical Releases](https://www.ttb.gov/beer/beer-stats.shtml), and **eight** data sets for [historical tax rates](https://www.ttb.gov/tax_audit/94a01_4.shtml) of distilled spirits, wine, beer, champagne, and tobacco. 14 | 15 | The motivation behind this package was to provide analysis-ready data sets as the original data for the `beermaterials` is in PDF format which can be difficult to read into R, given the small ecosystem of PDF parsing R packages such as: `tm`, and `tabulizer`. Other goals of this package are to provide more data sets to the R ecosystem for beer analytics from *open government data portals*. 16 | 17 | ## How to install this package? 18 | 19 | To install the package type the following: 20 | 21 | ```r 22 | install.packages("ttbbeer") 23 | library("ttbbeer") 24 | ``` 25 | 26 | Or you can install the development version from Github: 27 | 28 | ```r 29 | library(devtools) 30 | install_github("jasdumas/ttbbeer") 31 | library(ttbbeer) 32 | ``` 33 | 34 | ## How to use this package? 35 | 36 | The components of the package are a data set called `beermaterials` which includes the materials used by U.S. breweries during beer production as reported on a monthly basis to the U.S. Department of the Treasury, Alcohol and Tobacco Tax and Trade Bureau (TTB) from 2006 to 2015. The other components of this package include **eight data sets** depicting the historical tax rate of distilled spirits, wine, beer, champagne, and tobacco. 37 | 38 | Several different types of data analysis projects can be conducted by using this data such as: **Exploratory Data Analysis**, and **Time Series Analysis**. The intended audience of this data is everyone but especially for those interested in open government data or beer analytics. 39 | 40 | ```r 41 | data("beermaterials") 42 | data("artificialcarbontax") 43 | data("champagnetax") 44 | data("spirittax") 45 | data("winetax14") 46 | data("winetax1421") 47 | data("winetax2124") 48 | data("beertax") 49 | data("tobaccotax") 50 | ``` 51 | 52 | This project is released with a [Contributor Code of Conduct](https://github.com/jasdumas/ttbbeer/blob/master/CONDUCT.md). By participating in this project you agree to abide by its terms. 53 | 54 | ## Contact 55 | 56 | Package Author: Jasmine Daly [dalyanalytics.com](https://dalyanalytics.com) 57 | -------------------------------------------------------------------------------- /data-raw/get_data_process.R: -------------------------------------------------------------------------------- 1 | ## R data package process 2 | 3 | # --------- if I already have csv files: ----------- # 4 | 5 | library(readr) 6 | 7 | beermaterials <- read_csv("~/Desktop/R-directory/ttbbeer/data/materials_used_at_breweries_in_lbs.csv") 8 | 9 | devtools::use_data(beermaterials, overwrite = T) # creates .rda file in data/ 10 | 11 | devtools::use_build_ignore("get_data_process.R") # ignore this file in the package build in .Rbuildignore 12 | 13 | devtools::use_data_raw() # adds file to data-raw/ 14 | 15 | 16 | # --------- webscraping & other methods: ----------- # 17 | 18 | library(rvest) 19 | 20 | # distilled spirit historical tax rate 21 | spirittax <- read_html("https://www.ttb.gov/tax_audit/94a01_4.shtml") %>% 22 | html_node("#table") %>% 23 | html_table(fill=T) 24 | # change column names 25 | colnames(spirittax) <- spirittax[3, ] 26 | 27 | # remove missing columns 28 | spirittax <- spirittax[-c(12:23, 25:30 ), ] 29 | 30 | # remove the first 3 rows 31 | spirittax <- spirittax[-c(1:3), ] 32 | 33 | # fix last row 34 | spirittax[15,] <- c("01/01/1991", "7/10/2016", 13.50) 35 | 36 | # format FROM and TO columns with date 37 | library(lubridate) 38 | 39 | FROM <- mdy(spirittax[, "FROM"]) 40 | TO <- mdy(spirittax[, "TO"]) 41 | 42 | spirittax$FROM <- FROM 43 | spirittax$TO <- TO 44 | 45 | # fix RATE column to be numeric 46 | spirittax$RATE <- as.numeric(spirittax$RATE) 47 | 48 | # add to data/ folder then add to globalVariables.R 49 | devtools::use_data(spirittax, overwrite = T) # creates .rda file in data/ 50 | 51 | # ------------------- # 52 | 53 | # wine not over 14% ABV historical tax rate (government web developers put 54 | # the same id for all tables, sadface!) 55 | alltables <- read_html("https://www.ttb.gov/tax_audit/94a01_4.shtml") %>% 56 | html_table(fill=T) 57 | # ------------------- # 58 | winetax14 <- as.data.frame(alltables[2]) 59 | colnames(winetax14) <- winetax14[3, ] 60 | winetax14[14,] <- c("01/01/1991", "7/10/2016", 1.07) 61 | winetax14 <- winetax14[-c(1:3),] 62 | winetax14$FROM <- mdy(winetax14$FROM) 63 | winetax14$TO <- mdy(winetax14$TO) 64 | winetax14$RATE <- as.numeric(winetax14$RATE) 65 | devtools::use_data(winetax14, overwrite = T) 66 | 67 | # ------------------- # 68 | 69 | winetax1421 <- as.data.frame(alltables[3]) 70 | colnames(winetax1421) <- winetax1421[3, ] 71 | winetax1421[14,] <- c("01/01/1991", "7/10/2016", 1.57) 72 | winetax1421 <- winetax1421[-c(1:3),] 73 | winetax1421$FROM <- mdy(winetax1421$FROM) 74 | winetax1421$TO <- mdy(winetax1421$TO) 75 | winetax1421$RATE <- as.numeric(winetax1421$RATE) 76 | devtools::use_data(winetax1421, overwrite = T) 77 | 78 | # ------------------- # 79 | 80 | winetax2124 <- as.data.frame(alltables[4]) 81 | colnames(winetax2124) <- winetax2124[3, ] 82 | winetax2124[14,] <- c("01/01/1991", "7/10/2016", 3.15) 83 | winetax2124 <- winetax2124[-c(1:3),] 84 | winetax2124$FROM <- mdy(winetax2124$FROM) 85 | winetax2124$TO <- mdy(winetax2124$TO) 86 | winetax2124$RATE <- as.numeric(winetax2124$RATE) 87 | devtools::use_data(winetax2124, overwrite = T) 88 | 89 | # ------------------- # 90 | # champagne or sparkling wine! 91 | champagnetax <- as.data.frame(alltables[5]) 92 | colnames(champagnetax) <- champagnetax[3, ] 93 | champagnetax[18, ] <- c("01/01/1955", "7/10/2016", 3.40) 94 | champagnetax <- champagnetax[-c(1:5, 15:17), ] 95 | champagnetax$FROM <- mdy(champagnetax$FROM) 96 | champagnetax$TO <- mdy(champagnetax$TO) 97 | champagnetax$RATE <- as.numeric(champagnetax$RATE) 98 | devtools::use_data(champagnetax, overwrite = T) 99 | 100 | # ------------------- # 101 | 102 | artificialcarbontax <- as.data.frame(alltables[6]) 103 | colnames(artificialcarbontax) <- artificialcarbontax[3, ] 104 | artificialcarbontax[17, ] <- c("01/01/1955", "7/10/2016", 3.30) 105 | artificialcarbontax[8, ] <- c("06/26/1936", "06/30/1940", 0.0125) 106 | artificialcarbontax <- artificialcarbontax[-c(1:4, 9, 15),] 107 | artificialcarbontax$FROM <- mdy(artificialcarbontax$FROM) 108 | artificialcarbontax$TO <- mdy(artificialcarbontax$TO) 109 | artificialcarbontax$RATE <- as.numeric(artificialcarbontax$RATE) 110 | devtools::use_data(artificialcarbontax, overwrite = T) 111 | 112 | # ------------------- # 113 | 114 | beertax <- as.data.frame(alltables[7]) 115 | colnames(beertax) <- beertax[3, ] 116 | beertax[19, ] <- c("01/01/1991", "7/10/2016", 18) # $18/$7 117 | beertax[18, 3] <- 9 # $9/$7" 118 | beertax <- beertax[-c(1:3), ] 119 | beertax$FROM <- mdy(beertax$FROM) 120 | beertax$TO <- mdy(beertax$TO) 121 | beertax$RATE <- as.numeric(beertax$RATE) 122 | beertax[1, 1] <- mdy("09/01/1862") 123 | devtools::use_data(beertax, overwrite = T) 124 | 125 | # ------------------- # 126 | # tobacco and products 127 | 128 | tobaccotax <- as.data.frame(alltables[8]) 129 | colnames(tobaccotax) <- tobaccotax[2,] 130 | # fill in the blanks 131 | tobaccotax[c(4:8), 1] <- "SMALL CIGARETTE" 132 | tobaccotax[c(10:14), 1] <- "LARGE CIGARETTES" 133 | tobaccotax[c(16:19), 1] <- "SMALL CIGARS" 134 | tobaccotax[c(21:25), 1] <- "LARGE CIGARS" 135 | tobaccotax[c(27:30), 1] <- "CHEWING TOBACCO" 136 | tobaccotax[c(32:35), 1] <- "SNUFF" 137 | tobaccotax[c(37:40), 1] <- "PIPE TOBACCO" 138 | tobaccotax[42, 1] <- "Roll Your Own Tobacco" 139 | tobaccotax[c(44:45), 1] <- "Cigarette Papers" 140 | tobaccotax[c(47:48), 1] <- "Cigarette Tubes" 141 | # fix some of the dates 142 | tobaccotax[3, 2] <- "01/01/1951" # originally "101/01/1951" 143 | tobaccotax[15, 2] <- "01/01/1954" # originally "Prior to 1954 144 | tobaccotax[8, 3] <- "03/31/2009" # originally "103/31/2009" 145 | tobaccotax[14, 3] <- "03/31/2009" # originally "103/31/2009" 146 | tobaccotax[19, 3] <- "03/31/2009" # originally "103/31/2009" 147 | tobaccotax[20, 2:3] <- "02/01/1977" # originally "Prior to 02/01/77" 148 | tobaccotax[25, 3] <- "03/31/2009" # originally "103/31/2009" 149 | tobaccotax[42, 3] <- "03/31/2009" # originally "103/31/2009" 150 | tobaccotax[43, 2] <- "01/01/1993" # originally 1993 151 | tobaccotax[46, 2] <- "01/01/1993" # originally 1993 152 | tobaccotax[42, 3] <- "03/31/2009" # originally "103/31/2009" 153 | tobaccotax[40, 3] <- "03/31/2009" # originally "103/31/2009" 154 | tobaccotax[45, 3] <- "03/31/2009" # originally "103/31/2009" 155 | tobaccotax[48, 3] <- "03/31/2009" # originally "103/31/2009" 156 | tobaccotax[30, 3] <- "03/31/2009" # originally "103/31/2009" 157 | tobaccotax[35, 3] <- "03/31/2009" 158 | # change date format 159 | tobaccotax$FROM <- mdy(tobaccotax$FROM) 160 | tobaccotax$TO <- mdy(tobaccotax$TO) 161 | 162 | # extract out rate from column 163 | library(stringr) 164 | RATE <- str_extract(tobaccotax$RATE, "\\$[-0-9.,]+") 165 | RATE <- gsub("\\$","", RATE) 166 | RATE <- as.numeric(RATE) 167 | tobaccotax$RATE <- RATE 168 | 169 | # remove rows 170 | tobaccotax <- tobaccotax[-c(1:2), ] 171 | # save to data/ folder 172 | devtools::use_data(tobaccotax) 173 | -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.svg: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------