-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChopped.Rmd
90 lines (76 loc) · 2.01 KB
/
Chopped.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
title: "Chopped"
author: "Ashleigh Novak"
date: "8/25/2020"
output: html_document
---
```{r}
library(tidyverse)
#library(wesanderson)
library(ggridges)
library(ggthemes)
library(lubridate)
library(viridis)
```
```{r}
chopped <- readr::read_tsv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-08-25/chopped.tsv')
glimpse(chopped)
```
#Ggridges plot
```{r}
#Data manipulation
judge_time <- chopped %>%
pivot_longer(cols=8:10,
names_to = "Judge",
values_to = "Name") %>%
select("air_date", "series_episode", "Judge", "Name") %>%
mutate(air_date = as.Date.character(mdy(air_date)))
#Fix names
judge_time$Name[judge_time$Name=="Aarón Sanchez"] <- "Aarón Sánchez"
judge_time$Name[judge_time$Name=="Amanda Freita"] <- "Amanda Freitag"
judge_time$Name[judge_time$Name=="Chris Santo"] <- "Chris Santos"
judge_time2 <- judge_time %>%
filter(!is.na(Name)) %>%
group_by(Name) %>%
tally() %>%
arrange(desc(n))
#top ten
# Alex Guarnaschelli 208
# Amanda Freitag 206
# Scott Conant 194
# Marc Murphy 191
# Chris Santos 185
# Geoffrey Zakarian 183
# Aarón Sánchez 140
# Maneet Chauhan 128
# Marcus Samuelsson 78
# Martha Stewart 16
occurence <- judge_time %>%
filter(!is.na(Name)) %>%
group_by(Name, air_date)
target <- c("Alex Guarnaschelli",
"Amanda Freitag",
"Scott Conant",
"Marc Murphy",
"Chris Santos",
"Geoffrey Zakarian",
"Aarón Sánchez",
"Maneet Chauhan",
"Marcus Samuelsson",
"Martha Stewart")
p1 <- occurence %>%
# slice(1:10) %>%
filter(Name %in% target) %>%
ggplot(aes(x = air_date, y = Name, fill= Name)) +
geom_density_ridges(alpha = 0.9, scale = 5) +
scale_fill_viridis_d() +
#scale_fill_brewer(palette = "Spectral") +
labs(
title = "Top 10 judges appearances over time",
subtitle = "Some judges are more consistent in appearing on episodes over time than others") +
xlab("Air Date") +
theme_ridges(font_size = 13, grid = TRUE) +
theme(axis.title.y = element_blank(),
legend.position = "none")
p1
```