Skip to content

Instantly share code, notes, and snippets.

@hcozart
Created April 29, 2016 15:26
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 hcozart/732af5c604d179aaf3f0fba57b2c8aa0 to your computer and use it in GitHub Desktop.
Save hcozart/732af5c604d179aaf3f0fba57b2c8aa0 to your computer and use it in GitHub Desktop.
group_by(NYC_Death2 ,Year,Cause.of.Death)%>%
summarise(., Deaths = sum(Count))%>%
arrange(., Deaths)%>%
ggplot(data = ., aes(x= Year,y= Deaths)) +
geom_bar(aes(fill = reorder(Cause.of.Death, Deaths)),
position ="fill",stat = "identity") +
ylab(label = "Deaths" )+ scale_fill_discrete(name = "Cause of Death")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment