This is the code and data for https://david.frigge.nz/election2017/
Comments and questions welcome, by email, GitHub issue or tweet.
The site is created in R, with help from notable packages such as:
- nzelect for data
- flexdashboard for website design
- leaflet and leaflet.minicharts for interactive maps
- plotly for interactive plots
- sf for GIS functionality
- and of course most of the tidyverse for data munging
Various people deserve thanks and credits:
- Peter Ellis deserves explicit thanks for the excellent nzelect package, making the historical data easily accessible.
- The Electoral Commission for getting the new results out quickly and accessibly. (And Catalyst IT making it run smoothly in the background.)
- Chris McDowall inspired my interest in hexmaps three years ago (and others').
- Joseph Wright made shapefiles of his hexmaps available, which was fantastic. I wouldn't have been able to make that first step myself in the time available, so these were invaluable. And thanks to Stephen Beban for the pointer to these.
- Bhaskar Karambelkar's tilegram examples were my guide for using leaflet. (And I have to figure out how to get NZ data into the tilegramsR package.)