This is an extension of the tidytuesday assignment you have already done. Complete the questions below, using the screencast you chose for the tidytuesday assigment.
library(tidyverse)
library(lubridate)
theme_set(theme_light())
brewing_materials <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-31/brewing_materials.csv') %>%
mutate(date = ymd(paste(year, month, 1))) %>%
filter(year < 2016)
beer_taxed <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-31/beer_taxed.csv')
brewer_size <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-31/brewer_size.csv')
beer_states <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-31/beer_states.csv')
brewing_materials
## # A tibble: 1,152 x 10
## data_type material_type year month type month_current month_prior_year
## <chr> <chr> <dbl> <dbl> <chr> <dbl> <dbl>
## 1 Pounds o… Grain Produc… 2008 1 Malt… 374165152 365300134
## 2 Pounds o… Grain Produc… 2008 1 Corn… 57563519 41647092
## 3 Pounds o… Grain Produc… 2008 1 Rice… 72402143 81050102
## 4 Pounds o… Grain Produc… 2008 1 Barl… 3800844 2362162
## 5 Pounds o… Grain Produc… 2008 1 Whea… 1177186 1195381
## 6 Pounds o… Total Grain … 2008 1 Tota… 509108844 491554871
## 7 Pounds o… Non-Grain Pr… 2008 1 Suga… 78358212 83664091
## 8 Pounds o… Non-Grain Pr… 2008 1 Hops… 4506546 2037754
## 9 Pounds o… Non-Grain Pr… 2008 1 Hops… 621912 411166
## 10 Pounds o… Non-Grain Pr… 2008 1 Other 1291615 766735
## # … with 1,142 more rows, and 3 more variables: ytd_current <dbl>,
## # ytd_prior_year <dbl>, date <date>
This data set shows 4 different catergories of data that correlate to beer production in the United States. The data that I chose to analyze in this project was the data for brewing materials. In this data set, it shows the amount in pounds, and type of material for brewing beer. For example, the data shows pounds of grain products used, consisting of malt, corn, rice, barley, and wheat, and the total amount of grain products. It also shows non grain products used, such as sugar, hops, and other non grain materials. Along with each type, this set shows the year, and how much was used in the current month vs. the previous month. This is useful for comparing the amounts used as time passes.
Hint: One graph of your choice.
library(lubridate)
brewing_materials %>%
filter(!str_detect(material_type, "Total")) %>%
mutate(type = fct_reorder(type, month_current, sum)) %>%
ggplot(aes(date, month_current, fill = type)) +
geom_col() +
scale_y_continuous(labels = scales::comma) +
labs(x = "Time",
y = "Pounds used in beer production",
fill = "Material")
The graph that I chose for this assignment shows the amount of each material in pounds used during the brewing process over time. The graph is interestingly color coordinated for a nice viewing experience. What I found interesting about this graph is how more materials are used at different times throughout the year. The usage is high during the middle of the calander year for the summer months, and low when November and December come around. This graph also shows that some years used more brewing materials than other years.