Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. Y2009 <- filter(Data, IncidentDate < 20100000 & IncidentDate > 20090000)
  2. Y2010 <- filter(Data, IncidentDate < 20110000 & IncidentDate > 20100000)
  3. Y2011 <- filter(Data, IncidentDate < 20120000 & IncidentDate > 20110000)
  4. Y2012 <- filter(Data, IncidentDate < 20130000 & IncidentDate > 20120000)
  5. Y2013 <- filter(Data, IncidentDate < 20140000 & IncidentDate > 20130000)
  6. Y2014 <- filter(Data, IncidentDate < 20150000 & IncidentDate > 20140000)
  7. Y2015 <- filter(Data, IncidentDate < 20160000 & IncidentDate > 20150000)
  8. Y2016 <- filter(Data, IncidentDate < 20170000 & IncidentDate > 20160000)
  9. Y2017 <- filter(Data, IncidentDate < 20180000 & IncidentDate > 20170000)
  10. Y2018 <- filter(Data, IncidentDate < 20190000 & IncidentDate > 20180000)
  11. Y2019 <- filter(Data, IncidentDate < 20200000 & IncidentDate > 20190000)
  12. par(mfrow=c(5,1))
  13. hist(Y2009[,"IncidentDate"])
  14. hist(Y2010[,"IncidentDate"])
  15. hist(Y2011[,"IncidentDate"])
  16. hist(Y2012[,"IncidentDate"])
  17. hist(Y2013[,"IncidentDate"])
  18. #page2
  19. hist(Y2014[,"IncidentDate"])
  20. hist(Y2015[,"IncidentDate"])
  21. hist(Y2016[,"IncidentDate"])
  22. hist(Y2017[,"IncidentDate"])
  23. hist(Y2018[,"IncidentDate"])
  24. hist(Y2019[,"IncidentDate"])
  25. #I want to try group the dates by month to simplify it. And do it with a function to make it more elegant.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement