load("./data/wine150_tidy")
wine150_tidy %>%
select(country, points_avg_country) %>%
filter(country %in% c("Argentina", "Brazil", "Canada", "Chile", "Mexico", "Uruguay", "US")) %>%
mutate(country = fct_reorder(country, desc(points_avg_country))) %>%
unique() %>%
mutate(text_label = str_c("Country: ", country, "\nAverage Points: ", points_avg_country)) %>%
plot_ly(
x = ~country, y = ~points_avg_country, color = ~factor(country), text = ~text_label,
type = "bar", colors = "viridis") %>%
layout(
xaxis = list(title = "American Countries"),
yaxis = list(title = "Average Wine Points", range = (c(80,88))),
title = "Average Wine Points of American Countries")
From the bat plot of wine points for the 7 American countries, we could see that Canada has the highest average wine points (88.24) and Brazil has the lowest average wine points (83.24). Similarly to Europe, we also find out the richer North American countries have relatively higher average wine points and the poorer South American countries have relatively lower average wine points.
load("./data/wine150_tidy")
wine150_tidy %>%
select(points, country, winery, variety, points_avg_variety, points_avg_winery) %>%
filter(country %in% c("Argentina", "Brazil", "Canada", "Chile", "Mexico", "Uruguay", "US")) %>%
mutate(winery = fct_reorder(winery, desc(points_avg_winery))) %>%
filter(as.numeric(winery) <= 20) %>%
arrange(winery) %>%
plot_ly(
x = ~winery, y = ~points, color = ~factor(winery),
type = "box", colors = "viridis") %>%
layout(
xaxis = list(title = "American Wineries"),
yaxis = list(title = "Wine Points"),
title = "Top 20 American Wineries: Highest Professional Recognition")
One of the most important factors of wines is the producer. Usually, the high reputations of prestigious wineries serve as guarantees of great wine qualities. After calculating average wine points for American wineries, we have shown the top 20 American wineries with the highest average wine points, with Sloan being No.1 (100). The box plot has also provided quartiles of wine points for each winery.
load("./data/wine150_tidy")
wine150_tidy %>%
select(points, country, winery, variety, points_avg_variety, points_avg_winery) %>%
filter(country %in% c("Argentina", "Brazil", "Canada", "Chile", "Mexico", "Uruguay", "US")) %>%
mutate(winery = fct_reorder(winery, points_avg_winery)) %>%
filter(as.numeric(winery) <= 20) %>%
arrange(winery) %>%
plot_ly(
x = ~winery, y = ~points, color = ~factor(winery),
type = "box", colors = "viridis") %>%
layout(
xaxis = list(title = "American Wineries"),
yaxis = list(title = "Wine Points"),
title = "Bottom 20 American US Wineries: Lowest Professional Recognition")
We have also shown the bottom 20 American wineries with the lowest average wine points. From the box plot, we could see that all of them have received average wine points which are lower than or equal to 80.5. In addition, most of them have the same lowest average wine points (80).
load("./data/wine150_tidy")
wine150_tidy %>%
select(points, country, winery, variety, points_med_variety, points_med_winery) %>%
filter(country %in% c("Argentina", "Brazil", "Canada", "Chile", "Mexico", "Uruguay", "US")) %>%
mutate(variety = fct_reorder(variety, desc(points_med_variety))) %>%
filter(as.numeric(variety) <= 10) %>%
arrange(variety) %>%
plot_ly(
x = ~variety, y = ~points, color = ~factor(variety),
type = "violin", colors = "viridis") %>%
layout(
xaxis = list(title = "Grapes for American Wines"),
yaxis = list(title = "Wine Points"),
title = "Most Favorable 10 Grapes for American Wines: Highest Professional Recognition")
Wines’ qualities are predominantly determined by their raw materials: different grapes. Therefore, by calculating the median wine points of all kind of grapes for American wines, we have found out the top 10 grapes for American wines with the highest median wine points, with Trousseau Gris being No.1 (93). The violin plot has also provided quartiles of wine points for each kind of grape.
load("./data/wine150_tidy")
wine150_tidy %>%
select(points, country, winery, variety, points_med_variety, points_med_winery) %>%
filter(country %in% c("Argentina", "Brazil", "Canada", "Chile", "Mexico", "Uruguay", "US")) %>%
mutate(variety = fct_reorder(variety, points_med_variety)) %>%
filter(as.numeric(variety) <= 10) %>%
arrange(variety) %>%
plot_ly(
x = ~variety, y = ~points, color = ~factor(variety),
type = "violin", colors = "viridis") %>%
layout(
xaxis = list(title = "Grapes for American Wines"),
yaxis = list(title = "Wine Points"),
title = "Least Favorable 10 Grapes for American Wines: Lowest Professional Recognition")
We have also shown the bottom 10 kinds of grapes for American wines with the lowest median wine points. It is clear that Chambourcin and Chardonelle have received the lowest median wine points (82). In addition, the quartiles of wine points for each kind of grape have also been provided with violin plot.