Skip to content

Instantly share code, notes, and snippets.

@jonathanlxy
Created July 25, 2016 14:58
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/b1c8803a48ee11f3eaa853209cc154ea to your computer and use it in GitHub Desktop.
Save jonathanlxy/b1c8803a48ee11f3eaa853209cc154ea to your computer and use it in GitHub Desktop.
Vision Zero Visualization Blog Post Gist
# deaths per 1000 accidents
temp <- data.frame(PERIOD = death_n_label_dt$PERIOD,
d_rate = death_n_label_dt$N / accident_n_dt$N * 1000)
ggplot(data = temp, aes(x = PERIOD, y = d_rate)) +
geom_point(shape = 16, size = 3, color = 'red', alpha = .5) +
geom_line(aes(group = 1), size = 2, color = 'red', alpha = .5) +
labs(x = NULL, y = 'Deaths Per 1000 Accidents') +
theme(legend.position = 'none') +
geom_label(aes(y = d_rate + .03, label = round(d_rate, 2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment