Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
May 2019 Tidy Tuesday Submission
library(tidyverse)
library(ggridges)
library(viridis)
library(extrafont)
# font_import()
# loadfonts(device = "win")
wine_ratings <-
readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-28/winemag-data-130k-v2.csv")
ggplot(wine_ratings %>%
filter(!is.na(taster_name)),
aes(x = points,
y = taster_name,
fill = factor(..quantile..))) +
stat_density_ridges(
geom = "density_ridges_gradient",
calc_ecdf = TRUE,
quantiles = 4,
quantile_lines = FALSE) +
scale_fill_viridis(discrete = TRUE, name = "Quartiles", option = "D") +
labs(title = 'Distribution of Points by Wine Taster') +
xlab("Points") +
theme_minimal() +
theme(text = element_text(family = "Rockwell"),
axis.title.y = element_blank(),
legend.position = "none")
ggsave("may2019_tidy_tuesday.png", width = 5, height = 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.