Beer Craft Awards
The data set that I’ll use is a data set on craft beer awards from 2016 to 2020. Variables include:
medal, Gold, Silver, or Bronze
beer_name, the name of the beer
brewery, the name of the brewery
city, the city of the brewery
state, the state of the brewery
category, the type of beer
year, the year of the award
Using the usmap package, I will make a plot of the United States where states are coloured a darker colour if they have more beer awards in 2020 and a lighter colour if they have fewer beer awards in 2020.
The following usmap tutorial is a useful starting point:
https://cran.r-project.org/web/packages/usmap/vignettes/mapping.html
beer_awards <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-10-20/beer_awards.csv')
install.packages("usmap")
library(usmap)
library(tidyverse)
beer_awardsbeer_awards <- beer_awards %>% mutate(awards= fct_collapse(medal, award= c("Gold", "Bronze", "Silver")))
##3 min
beer_2020 <- beer_awards %>% filter(year ==2020) # 10 min
awards_df <- beer_2020 %>% group_by(state, awards) %>% summarise(count= n()) #4 min ## `summarise()` regrouping output by 'state' (override with `.groups` argument)
plot_usmap(data = awards_df, values = "count") + scale_fill_continuous(name = "Award (2020)", label = scales::comma) +
theme(legend.position = "right") #7 minQuestions to be answered:
- If you were moving to a place in the country solely based on having the best craft beer, where would you move to?
Answer:I would go to California.
- Are any states trending up or down in the number of beer awards per year?
Answer:Colorado and Oregon seem to be trending up.
- Are there any breweries that appear on this list many times?
Answer:Boston Beer Co. appears several times.