# Plotting Australia’s Polling Stations

#### 2017-05-24

This vignette dscribes how to show the polling stations on a map of the Australian electorates. The polling station locations for the 2013 election can be downloaded from http://results.aec.gov.au/17496/Website/GeneralDownloadsMenu-17496-csv.htm. This data is a reduced set of information. (The data sometimes needs to be cleaned a little in order to read properly into R: (1) One polling place has instructions for getting in that include 6" step which messes up the text read, (2) Two polling places have "F" and "B" in the instructions to get in that messes with the text reading. The data provided with the vignette has been cleaned.)

library(ggthemes)

data(nat_map)
data(nat_data)
ggplot(data = nat_data, aes(map_id = id)) + geom_map(map = nat_map, fill = "grey90",
colour = "white") + geom_point(data = stns, aes(x = Longitude, y = Latitude),
colour = "red", size = 1, alpha = 0.3, inherit.aes = FALSE) + xlim(c(112,
157)) + ylim(c(-44, -11)) + theme_map() + coord_equal()

## 2016 Update

data(nat_map_2016)
data(nat_data_2016)
ggplot(data = nat_data_2016, aes(map_id = id)) + geom_map(map = nat_map_2016,
fill = "grey90", colour = "white") + geom_point(data = stns, aes(x = Longitude,
y = Latitude), colour = "red", size = 1, alpha = 0.3, inherit.aes = FALSE) +
xlim(c(112, 157)) + ylim(c(-44, -11)) + theme_map() + coord_equal()

## Incorporating other information

Election results are provided at the resolution of polling place. We can use this information to color the points. The two files need to be merged. Both have id’s for the polling place, that can be used to match the records. The two party preferred votes are given in aec2013_2pp data, only for the Australian Labor Party and the Liberal/National Coalition. From these columns the winner needs to be calculated based on the higher percentage. This is used to colour the points on the polling places.

This gives a richer look at the party preferences across the country. You can see that although the big rural electorates vote the LNC overall some polling places would elect the ALP, e.g. western NSW around Broken Hill. This data would look far more interesting if the data also contained the minority parties, because there must be some polling places where the majority vote would be for a minor party, since there are some minor partt representatives in the House.