Skip to content

Instantly share code, notes, and snippets.

@tslumley
Created August 19, 2021 05:45
Show Gist options
  • Save tslumley/65ac755f65ca46ad8a07b30df55e2705 to your computer and use it in GitHub Desktop.
Save tslumley/65ac755f65ca46ad8a07b30df55e2705 to your computer and use it in GitHub Desktop.
counts<-c(173,291,320,407,311,292,341,321,188)
times<-c(as.numeric(as.Date("2013-12-31")-as.Date("2013-4-1")),365,365,366,365,365,365,366,as.numeric(as.Date("2021-7-19")-as.Date("2021-1-1")))
barplot(counts*365/times,width=times,col="royalblue",names=2013:2021,ylab="Assaults, scaled to /year",bg="white")
plot(2013:2021,counts*365/times,ylim=c(200,450),pch=19,col="royalblue",xlab="year",ylab="Assaults, scaled to /year",bg="white")
segments(2013:2021,(sqrt(counts)-1)^2*365/times, y1=(sqrt(counts)+1)^2*365/times,lty=3)
## from https://fyi.org.nz/request/16238/response/61990/attach/3/Kelly%20P%20IR%2001%2021%2023344%20Final%20Response.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment