Created
September 1, 2017 20:03
-
-
Save conormm/ae9b3669d15b53a1a3aaeb198c51e39e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df %>% | |
group_by(title_year) %>% | |
summarise(mean_rating = mean(imdb_score), | |
upper_rating = quantile(imdb_score, 0.975), | |
lower_rating = quantile(imdb_score, 0.0275)) %>% | |
ggplot(aes(title_year, mean_rating)) + | |
geom_line(colour = "dodger blue") + | |
geom_point(alpha = 0.5) + | |
geom_smooth(method = "lm", colour = "red", alpha = 0.6, se = FALSE) + | |
geom_errorbar(aes(ymin = upper_rating, ymax = lower_rating)) + | |
geom_rug() + | |
theme_minimal() + | |
labs(title = "Average IMDB movie rating per year", | |
x = "Year", | |
y = "IMDB rating") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment