-
-
Save jonathanlxy/5e969d1ef0ea8ed4fbf7be1d6b70b5ff to your computer and use it in GitHub Desktop.
Vision Zero Visualization Blog Post Gist
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
# 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