Bob’s Burgers

Author

Jo Hardin

Published

November 19, 2024

library(tidyverse) # ggplot, lubridate, dplyr, stringr, readr...
library(bobsburgersR)
library(praise)

The Data

This week we’re exploring Bob’s Burgers dialogue! Thank you to Steven Ponce for the data, and a blog post demonstrating how to visualize the data!

See the {bobsburgersR} R Package for the original transcript data, as well as additional information about each episode!

episode_metrics <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-11-19/episode_metrics.csv')

Dialogue

How often are particular words used in a particular episode? Can we see any patterns over season and episode?

We start with some gutter humor…

words <- c("fart", "crap", "toilet", "buns", "diarrhea",
           "poop", "(doo doo)")

list <- str_c("(?i)", str_c(words, collapse = "|"))
list
[1] "(?i)fart|crap|toilet|buns|diarrhea|poop|(doo doo)"
poop_data <- transcript_data |> 
  filter(str_detect(raw_text, list)) |> 
  filter(!str_detect(raw_text, "(?i)farth"))
poop_data |> 
  group_by(season, episode) |> 
  summarize(num_wrds = n()) |> 
  full_join(imdb_wikipedia_data, 
            by = c("season", "episode")) |> 
  ggplot(aes(y = num_wrds, x = episode, 
             color = as.factor(season))) + 
  geom_point(size = 3, show.legend = FALSE, alpha = 0.8) + 
  facet_wrap(~season) + 
  labs(y = "number of poop words",
       title = "Dialogue from Bob's Burgers")

Scater plot with the number of times poop, or a poop synonym, is said in the dialogue of Bob's Burgers. On the x axis the episode number is plotted. The graph is faceted by season.  There are not many trends except for a few episodes here and there with a lot of poop words.

Number of poop words in a particular episode in a given season.
words <- c("burger")

list <- str_c("(?i)", str_c(words, collapse = "|"))
list
[1] "(?i)burger"
other_data <- transcript_data |> 
  drop_na(raw_text) |> 
  mutate(word_in = str_detect(raw_text, list)) 
other_data |> 
  group_by(season, episode) |> 
  summarize(num_wrds = sum(word_in)) |> 
  full_join(imdb_wikipedia_data, 
            by = c("season", "episode")) |> 
  ggplot(aes(y = num_wrds, x = episode)) + 
  geom_text(aes(label = "hamburger"), size = 3,
            color = "darkorange", family = "Font Awesome 5 Free Solid") +
  facet_wrap(~season) + 
  labs(subtitle = "number of times burger is said",
       title = "Dialogue from Bob's Burgers")

Scater plot with the number of times burger is said in the dialogue of Bob's Burgers. On the x axis the episode number is plotted. The graph is faceted by season. The word burger is said most often in the early seasons.

Number of times “burger” is said in a particular episode in a given season.
praise()
[1] "You are best!"