-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
98 lines (72 loc) · 3.46 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
title: "2020 NZ Election"
output:
flexdashboard::flex_dashboard:
vertical_layout: scroll
theme: spacelab
self_contained: false
css: https://fonts.googleapis.com/css?family=Open%20Sans
lib_dir: lib
mathjax: null
navbar:
- { title: "Intro", icon: "fa-home", align: left }
- { title: "Parties", icon: "ion-ios-settings-strong", href: "dumbbells.html", align: left }
- { title: "Refs", icon: "ion-ios-settings-strong", href: "referenda.html", align: left }
- { title: "Hexmaps", icon: "ion-cube", href: "hexmaps.html", align: left }
- { title: "@dakvid", icon: "fa-twitter", href: "https://twitter.com/dakvid", align: right }
social: menu
source_code: https://github.com/dakvid/election2020
---
```{r init, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
knitr::opts_chunk$set(message = FALSE)
knitr::opts_chunk$set(warning = FALSE)
```
```{r setup, include=FALSE}
library(flexdashboard)
```
##
### Welcome
We just had [an election](https://en.wikipedia.org/wiki/New_Zealand_general_election,_2020) in New Zealand. Yay!
I was going to sit this one out and enjoy everyone else's analysis, but there wasn't as much as I expected -
especially good maps. Luckily I spent some time [visualising the 2017 election](https://david.frigge.nz/election2017/)
and the code was relatively straightforward to adapt.
One large caveat is that around half of the electorates had boundary changes between 2017 and 2020, so
comparisons of voting changes may be due in part to different populations.
There's also a new electorate, which at least made the hexmaps more than simply re-running
code with new numbers.
Note that these pages are *desktop friendly*.
They don't "fail" as such on mobile, but if you really want to poke about in the
detail you'll fare better on a larger screen.
David Friggens, October/November 2020
### Hexmaps
<p>
<a href="hexmaps.html"><img width="49%" src="images/intro_hex_nat.png" /></a>
<a href="hexmaps.html"><img width="49%" src="images/intro_hex_lab.png" /></a>
</p>
Geographical maps of results don't give a good representation of the spread of support
various parties have. So here are some cartograms with one tile per electorate. You can
see candidate race winners and vote concentration for the main parties.
##
### Dumbbells: Party Votes
<p>
<a href="dumbbells.html"><img width="49%" src="images/intro_db_grn.png" /></a>
<a href="dumbbells.html"><img width="49%" src="images/intro_db_nzf.png" /></a>
</p>
We know which parties gained and lost votes since 2017, but the national number doesn't
tell the full story. Was there universal swing, or were there localised ups and
downs? These dumbbell plots help make it clear, both for individual parties and
the overall Left vs Right shift.
<p><a href="dumbbells.html"><img width="100%" src="images/intro_db_lr.png" /></a></p>
### Referenda Votes
How variable was the support for the two referenda on the ballot this year?
We can compare with some dot and dumbbell plots.
<p><a href="referenda.html"><img width="100%" src="images/intro_db_ref.png" /></a></p>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-30013353-2', 'auto');
ga('send', 'pageview');
</script>