# Plotting Australia’s Polling Stations

#### 2016-05-23

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 provide with the vignette has been cleaned.)

# Make it look like a map
theme_map <- theme_bw()
theme_map$line <- element_blank() theme_map$strip.text <- element_blank()
theme_map$axis.text <- element_blank() theme_map$plot.title <- element_blank()
theme_map$axis.title <- element_blank() theme_map$panel.border <- element_rect(colour = "white", size = 1, fill = NA)

data(nat_map)
ggplot(data = nat_map) + geom_polygon(aes(x = long, y = lat, group = group,
order = order), fill = "grey90", colour = "white") + geom_point(data = stns,
aes(x = Longitude, y = Latitude), colour = "red", size = 1, alpha = 0.3) +
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.