Downloads and returns a data frame containing the points that make up the centroids for each of the Australian electorates in the desired federal election.

nat_data_download(year, ...)

Arguments

year

Desired year, must be one of 2001, 2004, 2007, 2010, 2011, 2013, 2016, 2019

...

Additional arguments passed to `download.file`

Value

A data frame with data associated with each of the Australian federal electorates

  • id: Numeric identifier for the polygon

  • elect_div: Electorate division name

  • state: abbreviation of the state name

  • numccds: AEC variable that might be filled with meaning or a description down the road

  • area_sqkm: combined square kilometers of each electorate

  • long_c: longitude coordinate of electorate (polygon) centroid

  • lat_c: latitude coordinate of electorate (polygon) centroid

  • x: latitude coordinate for plotting a cartogram

  • y: longitude coordinate for plotting a cartogram

  • radius: variable used in the construction of cartogram points

Examples

library(eechidna)
library(dplyr)
library(ggmap)
#>  Google's Terms of Service: <https://mapsplatform.google.com>
#>  Please cite ggmap if you use it! Use `citation("ggmap")` for details.

nat_data19 <- nat_data_download(2019)

nat_data19 %>%
  qmplot(long_c, lat_c, data=.)
#>  Using `zoom = 5`
#>  Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.