Skip to content

Instantly share code, notes, and snippets.

@conormm
Created September 1, 2017 14:53
Show Gist options
  • Save conormm/742bbdab37c47efd50cd9ffdce530081 to your computer and use it in GitHub Desktop.
Save conormm/742bbdab37c47efd50cd9ffdce530081 to your computer and use it in GitHub Desktop.
imdb_score_summary <- df %>%
summarise_each(funs(min, max, mean, median, sd), imdb_score) %>%
gather(stat, value)
df %>%
ggplot(aes(imdb_score)) +
geom_histogram(bins = 50, colour = "black", fill = "red", alpha = 0.4) +
theme_minimal() +
annotation_custom(tableGrob(imdb_score_summary, rows = NULL),
xmin = 2.5,
xmax = 4,
ymin = 300, ymax = 400) +
labs(title = "IMDB score distribution")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment