Skip to content

Commit

Permalink
Add visualization of film ranking
Browse files Browse the repository at this point in the history
  • Loading branch information
erictleung committed Nov 18, 2024
1 parent 0ce1ceb commit c3df866
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions data-raw/get_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,8 @@ pixar_rankings <-


## Visualize rankings ----

# Basic visualization
pixar_rankings %>%
ggplot(aes(ranking, fct_reorder(film, ranking, .desc = TRUE))) +
geom_boxplot() +
Expand All @@ -1144,6 +1146,26 @@ pixar_rankings %>%
labs(x = "Ranking", y = "Film")
# ggsave("pixar_rankings.png", width = 10, height = 6)

# Add information by decade
pixar_rankings %>%
left_join(
pixar_films %>%
select(film, release_date) %>%
mutate(release_decade = year(release_date) - year(release_date) %% 10) %>%
mutate(release_decade = as.factor(release_decade)),
by = "film"
) %>%
ggplot(aes(
ranking,
fct_reorder(film, ranking, .desc = TRUE),
fill = release_decade
)) +
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", fill = "Release decade")
# ggsave("pixar_rankings_decade.png", width = 10, height = 6)


# Calculate consensus ranking ---------------------------------------------
Expand Down

0 comments on commit c3df866

Please sign in to comment.