-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
131 lines (96 loc) · 5.92 KB
/
README.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo=FALSE}
library(bobsburgersR)
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(tidyr))
```
# bobsburgersR <img src="img/bobsburgersR.png" align="right" height="240"/>
[![R-CMD-check](https://github.com/poncest/bobsburgersR/workflows/R-CMD-check/badge.svg)](https://github.com/poncest/bobsburgersR/actions) ![Lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange) ![License](https://img.shields.io/badge/license-MIT-blue.svg)
A collection of datasets on the [Bob's Burgers](https://www.fox.com/bobs-burgers/) American animated sitcom. This package aims to provide easy access to data about the show, allowing for analysis of trends in ratings, character dialogue, and more. Included in the package are 2 datasets detailed below for seasons 1-14.
# Installation
Install from GitHub:
```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("poncest/bobsburgersR")
```
# Data Dictionary
## `imdb_wikipedia_data`
| Column Name | Data Type | Description |
|-------------------|------------------|-----------------------------------|
| `episode_overall` | `dbl` | The overall episode number in the entire Bob's Burgers series (starting from episode 1). |
| `imdb_aired_date` | `date` | The date the episode originally aired, according to IMDb. Format: YYYY-MM-DD. |
| `year` | `dbl` | The year the episode aired. |
| `season` | `dbl` | The season number of the episode within the Bob's Burgers TV show. |
| `episode` | `dbl` | The episode number within the specific season of the Bob's Burgers TV show. |
| `imdb_title` | `chr` | The title of the episode, as listed on IMDb. |
| `rating` | `dbl` | The IMDb user rating of the episode (on a scale from 1 to 10). |
| `synopsis` | `chr` | A brief description or synopsis of the episode, summarizing the key plot points, according to IMDb. |
| `wikipedia_directed_by` | `chr` | The name(s) of the director(s) of the episode, as listed on Wikipedia. |
| `wikipedia_written_by` | `chr` | The name(s) of the writer(s) of the episode, as listed on Wikipedia. |
| `wikipedia_viewers` | `dbl` | The number of US viewers (in millions) who watched the episode when it first aired, according to Wikipedia. |
### Notes:
- **IMDb vs. Wikipedia**: `imdb_aired_date`, `imdb_title`, `rating`, and `synopsis` are from IMDb, while `wikipedia_directed_by`, `wikipedia_written_by`, and `wikipedia_viewers` are from Wikipedia. Both sources provide complementary data for the same episodes.
- Viewer numbers (`wikipedia_viewers`) represent the viewership in millions, so 9.38 means 9.38 million viewers.
## `transcript_data`
| Column Name | Data Type | Description |
|-------------------|-------------------|----------------------------------|
| `season` | `dbl` | The season number in which the episode is part of the Bob's Burgers TV show. |
| `episode` | `dbl` | The episode number within the specific season of Bob's Burgers. |
| `title` | `chr` | The title of the episode in which the dialogue line appears. |
| `line` | `dbl` | The line number of the dialogue in the episode (the order in which it appears). |
| `raw_text` | `chr` | The original raw text of the dialogue, possibly including formatting or special characters. |
| `dialogue` | `chr` | Cleaned-up version of the `raw_text`, containing the actual dialogue spoken by the characters in the episode. |
------------------------------------------------------------------------
### Notes:
- The `raw_text` column contains the unprocessed version of the dialogue, while `dialogue` is the cleaned-up version.
# Examples
## IMDb Ratings by Season
This plot shows the distribution of IMDb ratings for each season, with individual episode ratings represented as jittered points.
```{r, warning=FALSE}
data("imdb_wikipedia_data")
head(imdb_wikipedia_data)
# Box Plot with Jitter: IMDb Ratings by Season
ggplot(imdb_wikipedia_data, aes(x = as.factor(season), y = rating)) +
geom_boxplot(fill = "lightblue", color = "black", outlier.shape = NA) + # Avoid duplicate points by not showing boxplot outliers
geom_point(alpha = 0.6, color = "darkred", position = position_jitter(seed = 42, width = 0.2)) +
labs(
title = "IMDb Ratings by Season",
x = "Season",
y = "IMDb Rating"
) +
theme_minimal()
```
## Heatmap: Lines Spoken by Season and Episode
The following heatmap shows the number of dialogue lines spoken in each episode across different seasons of Bob's Burgers.
```{r, warning=FALSE, message=FALSE}
data("transcript_data")
head(transcript_data)
## Heatmap: Lines Spoken by Season and Episode
# Summarize number of lines per episode per season
heatmap_data <- transcript_data |>
filter(!is.na(dialogue)) |>
group_by(season, episode) |>
summarize(total_lines = n(), .groups = "drop")
# Heatmap: Lines Spoken by Season and Episode
ggplot(heatmap_data, aes(x = as.factor(episode), y = as.factor(season), fill = total_lines)) +
geom_tile(color = "white") +
scale_fill_gradient(low = "lightyellow", high = "red") +
coord_equal() +
labs(
title = "Lines Spoken by Season and Episode",
x = "Episode",
y = "Season",
fill = "Total Lines"
) +
theme_minimal()
```
# Question/Contribute
If there is any data you would like to include or if you have suggestions, please get in touch. You can contact me at [steven_ponce\@yahoo.com](mailto:steven_ponce@yahoo.com) or open an issue on the [GitHub repository](https://github.com/poncest/bobsburgersR/issues).
# References
1. IMDb: [Episodes List](https://www.imdb.com/title/tt1561755/episodes/?season=1)
2. Wikipedia (episodes): [List of Bob's Burgers episodes](https://en.wikipedia.org/wiki/List_of_Bob%27s_Burgers_episodes#Episodes)
3. Springfield! Springfield! (episode scripts): [Springfield Springfield - Bob's Burgers scripts](https://www.springfieldspringfield.co.uk/episode_scripts.php?tv-show=bobs-burgers)