Skip to content

Commit

Permalink
Add all rankings together and plot rankings
Browse files Browse the repository at this point in the history
  • Loading branch information
erictleung committed Nov 17, 2024
1 parent dd05364 commit 9992856
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions data-raw/get_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,51 @@ forbes_ranking <- add_source(forbes_ranking, "Forbes")
# )


## Join all rankings together ----
pixar_rankings <-
bind_rows(
rotten_tomatoes_ranking,
ign_ranking,
indie_wire_ranking,
slant_ranking,
vox_ranking,
wired_ranking,
thrillist_ranking,
screenrant_ranking,
polygon_ranking,
buzzfeed_ranking,
cnet_ranking,
insider_ranking,
av_club_ranking,
vulture_ranking,
independent_ranking,
forbes_ranking
) %>%
mutate(
film = trimws(film),
ranking = as.numeric(ranking)
) %>%
mutate(film = case_when(
film %in% c("Monsters Inc.", "Monsters, Inc") ~ "Monsters, Inc.",
film == "Monster’s University" ~ "Monsters University",
film == "Wall-E" ~ "WALL-E",
film == "A Bug’s Life" ~ "A Bug's Life",
film == "The Incredibles 2" ~ "Incredibles 2",
TRUE ~ film
))


## Visualize rankings ----
pixar_rankings %>%
ggplot(aes(ranking, fct_reorder(film, ranking, .desc = TRUE))) +
geom_boxplot() +
theme_minimal() +
theme(text = element_text(size = 15)) +
ggtitle("Distribution of Pixar film rankings", "Ordered by median ranking") +
labs(x = "Ranking", y = "Film")
ggsave("pixar_rankings.png", width = 10, height = 6)


# Save out data for use ---------------------------------------------------

# Join all data into single, long data frame
Expand Down

0 comments on commit 9992856

Please sign in to comment.