Code
library(tidyverse) # ggplot, lubridate, dplyr, stringr, readr...
library(ggrepel)
library(pixarfilms)
library(praise)
library(tidyverse) # ggplot, lubridate, dplyr, stringr, readr...
library(ggrepel)
library(pixarfilms)
library(praise)
This week we’re exploring Pixar films! The data this week comes from the {pixarfilms} R package by Eric Leung.
R data package to explore Pixar films, the people, and reception data. This package contains six data sets provided mostly in part by Wikipedia.
data(academy)
data(box_office)
data(genres)
data(pixar_films)
data(pixar_people)
data(public_response)
|>
public_response ggplot(aes(x = rotten_tomatoes, y = metacritic)) +
geom_point() +
geom_label_repel(aes(label = film, color = cinema_score))
<- academy |>
joined left_join(pixar_films, by = "film") |>
mutate(film = fct_reorder(film, release_date, .desc = TRUE)) |>
mutate(award_type = factor(award_type,
levels = c("Best Picture",
"Animated Feature",
"Original Screenplay",
"Adapted Screenplay",
"Original Score",
"Original Song",
"Sound Editing",
"Sound Mixing",
"Other"))) |>
mutate(status = factor(status,
levels = c("Won", "Nominated", "Ineligible",
"Award not yet introduced",
"Won Special Achievement"))) |>
mutate(year = year(release_date)) |>
mutate(film_date = fct_reorder(paste0(film, " (", year, ")"),
.desc = TRUE))
release_date,
|>
joined select(film, release_date, year, film_date)
# A tibble: 80 × 4
film release_date year film_date
<fct> <date> <dbl> <fct>
1 Toy Story 1995-11-22 1995 Toy Story (1995)
2 Toy Story 1995-11-22 1995 Toy Story (1995)
3 Toy Story 1995-11-22 1995 Toy Story (1995)
4 Toy Story 1995-11-22 1995 Toy Story (1995)
5 Toy Story 1995-11-22 1995 Toy Story (1995)
6 Toy Story 1995-11-22 1995 Toy Story (1995)
7 A Bug's Life 1998-11-25 1998 A Bug's Life (1998)
8 A Bug's Life 1998-11-25 1998 A Bug's Life (1998)
9 A Bug's Life 1998-11-25 1998 A Bug's Life (1998)
10 Toy Story 2 1999-11-24 1999 Toy Story 2 (1999)
# ℹ 70 more rows
library(showtext)
font_add_google("Gochi Hand", "pixar")
showtext_auto()
|>
joined ggplot(aes(y = film_date, x = award_type, color = status)) +
geom_point() +
theme_minimal(base_family = "pixar") +
theme(axis.text.x =
element_text(angle = 45,
vjust = 0.5,
hjust=0.5,
size = 30),
axis.text.y = element_text(size = 30),
legend.text = element_text(size = 20)) +
labs(x = "", y = "", color = "") +
scale_color_brewer(palette = "Set1")
praise()
[1] "You are incredible!"