Skip to content

Instantly share code, notes, and snippets.

@jonathanlxy
Last active July 25, 2016 14:56
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/5e969d1ef0ea8ed4fbf7be1d6b70b5ff to your computer and use it in GitHub Desktop.
Save jonathanlxy/5e969d1ef0ea8ed4fbf7be1d6b70b5ff to your computer and use it in GitHub Desktop.
Vision Zero Visualization Blog Post Gist
# Yearly Average Injury per Accident
temp <- injur_n_label_dt %>%
mutate(injur_rate = N / accident_n_dt$N)
ggplot(data = temp, aes(x = PERIOD, y = injur_rate)) +
geom_line(group = 1, size = 2, alpha = .5, color = 'red') +
geom_label(aes(label = round(injur_rate, 3))) +
labs(x = NULL, y = 'Injury Per Accident') +
theme(legend.position = 'none',
axis.text=element_text(size=12),
axis.title=element_text(size=14,face="bold")) +
coord_cartesian(ylim = c(0, .5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment