Skip to content

Instantly share code, notes, and snippets.

@abkosar
Created April 29, 2016 19: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 abkosar/88512e9b96003d1456aace445b125aaf to your computer and use it in GitHub Desktop.
Save abkosar/88512e9b96003d1456aace445b125aaf to your computer and use it in GitHub Desktop.
##############################################
#####BOROUGH ANALYSIS BY NUMBER OF DEATHS#####
##############################################
Borough_Deaths_Years <- by_borough %>% summarise(total_people_killed = sum(NUMBER.OF.PERSONS.KILLED))
#############TOTAL PEOPLE KILLED IN COLLISIONS BY BOROUGH FOR EACH YEAR#############
Total_Deaths_by_Years = ggplot(data = Borough_Deaths_Years, aes(x = Year, y = total_people_killed)) +
geom_bar(aes(fill = BOROUGH), stat = 'identity') +
theme_economist() +
theme(legend.position = "right") +
theme(legend.text=element_text(size=5)) +
ggtitle('Total People Killed in Collisions by Year') +
ylab("Number of Total Deaths\n") +
xlab("\nYear") +
scale_fill_brewer(palette = "Blues") +
theme(axis.text.x = element_text(vjust = 0, angle = 0, hjust = 0.5)) +
theme(legend.position = "right") +
theme(legend.text=element_text(size=10))
Total_Deaths_by_Years
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment