library(tidyverse)
library(praise)
The Richmond Way
The Data
For Deepsha Menghani’s talk on Data Viz animation and interactivity in Quarto, she watched each episode of Ted Lasso at 2X speed and diligently noted down every F*bomb and gesture reference, and then made it into the richmondway R package!
<- read.csv("richmondway.csv") |>
richmondway ::clean_names() janitor
Exploring
|>
richmondway ggplot(aes(x = episode_order, y = imdb_rating)) +
geom_point() +
geom_vline(xintercept = 10.5, color = "blue") +
geom_vline(xintercept = 22.5, color = "blue")
Roy Kent
|>
richmondway mutate(f_count_else = f_count_total - f_count_rk) |>
pivot_longer(cols = c(`f_count_rk`,`f_count_else`), names_to = "who", values_to = "count") |>
mutate(who = ifelse(who == "f_count_rk", "Roy Kent", "someone else")) |>
mutate(count = ifelse(who == "Roy Kent", -count, count)) |>
ggplot(aes(x = episode_order, y = count, fill = imdb_rating)) +
geom_bar(stat = "identity", width = 0.8) +
geom_hline(yintercept = 0, lwd = 1.5) +
geom_vline(xintercept = 10.5, color = "darkgrey", lwd = 0.5) +
geom_vline(xintercept = 22.5, color = "darkgrey", lwd = 0.5) +
scale_x_reverse(limits = c(40, 0)) +
scale_y_continuous(breaks = seq(-25, 50, by = 5),
labels = as.character(c(seq(25, 0, by = -5), seq(5, 50, by = 5)))) +
annotate("text", x = c(2, 13, 25), y = -21, label = c("Season 1", "Season 2", "Season 3")) +
annotate("text", x = 39, y = c(-12.5, 14.5), label = c("F**k count, Roy Kent", "F**k count, everyone else"), color = "darkred", size = 5) +
coord_flip() +
scale_fill_gradient(high = "red", low = "darkblue") +
labs(x = "", y = "",
fill = "IMDB rating") +
theme(axis.text.y = element_blank(), axis.ticks.y = element_blank())
praise()
[1] "You are transcendent!"