Skip to content

Instantly share code, notes, and snippets.

@jonathanlxy
Last active July 25, 2016 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanlxy/4d7b35000c8ad86b2ea967c8c25de7e8 to your computer and use it in GitHub Desktop.
Save jonathanlxy/4d7b35000c8ad86b2ea967c8c25de7e8 to your computer and use it in GitHub Desktop.
Vision Zero Visualization Blog Post Gist
# Total count by period
accident_n_dt <- work_dt %>%
group_by(PERIOD) %>%
summarise(N = n())
ggplot(data = accident_n_dt) +
geom_bar(aes(x = PERIOD, y = N, fill = PERIOD), stat = 'identity') +
labs(y = NULL,
title = 'Number of Motor Vehicle Collisions for Each 12-Month Period') +
theme(legend.position = 'none',
axis.text=element_text(size=12),
axis.title=element_text(size=14,face="bold")) +
scale_y_continuous(labels = scales::comma) +
geom_text(aes(x = PERIOD, y = N - 6000, label = N), size = 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment