SHARE
TWEET

Untitled

a guest Apr 18th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```{r}
  2.  
  3. total_change <- murder_tiny %>%
  4.   group_by(state) %>%
  5.   summarise(murders2015= sum(murders_2015),
  6.   murders2016= sum(murders_2016),
  7.   change= sum(change),
  8.   per_change= change*100/murders2015) %>%
  9.   arrange(desc(change))%>%
  10.   head(10)
  11.  
  12. total_change
  13. ```
  14. ```{r}
  15. p1 <- ggplot(total_change,
  16.               aes(x= reorder(state, change), y=change))+
  17.         geom_col(aes(fill=state), alpha=0.7) +
  18.         coord_flip() +
  19.         labs(x="State", y="Increase Number", title = "Top 10 Murder Increase in each State") +
  20.         theme_minimal()
  21. p1
  22.  
  23. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top