Skip to content

Instantly share code, notes, and snippets.

@tslumley
Created October 29, 2015 00:31
Show Gist options
  • Save tslumley/12217c1a84dec5f4a8de to your computer and use it in GitHub Desktop.
Save tslumley/12217c1a84dec5f4a8de to your computer and use it in GitHub Desktop.
Hextri examples
library(hextri)
library(survey)
data(api)
## all hexes same orientation: looks as if middle schools went up more
with(apipop,hextri(api99,api00,stype,c("orange","forestgreen","purple"),nbins=20,diffuse=FALSE,
xlab="1999 Academic Performance Index",ylab="2000 Academic Performance Index",style="size"))
legend("topleft",fill=c("orange","purple","forestgreen"),legend=c("Elementary","Middle","High"),bty="n")
## random orientation: less pretty, but you can see middle schools went up less
with(apipop,hextri(api99,api00,stype,c("orange","forestgreen","purple"),nbins=20,diffuse=TRUE,
xlab="1999 Academic Performance Index",ylab="2000 Academic Performance Index",style="size"))
legend("topleft",fill=c("orange","purple","forestgreen"),legend=c("Elementary","Middle","High"),bty="n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment