get_electorate_shapes: Extract shapefiles (of Australian electorates) from raw file...

Description Usage Arguments Value Examples

View source: R/shapefiles.R

Description

Extract polygon information and demographics for each of Australia's electorates. The map and data corresponding to the shapefiles of the 2013 Australian electorates (available at https://www.aec.gov.au/Electorates/gis/gis_datadownload.htm) are part of this package as nat_map.rda and nat_data.rda in the data folder. The function will take several minutes to complete.

Usage

1
2
3
4
5
6
7
get_electorate_shapes(
  path_to_shapeFile = NULL,
  sF = NULL,
  mapinfo = TRUE,
  layer = NULL,
  tolerance = 0.005
)

Arguments

path_to_shapeFile

path to object in local machine (only if shapefile has not already loaded)

sF

Shapefile object loaded to environment using load_shapefile

mapinfo

Is the data mapInfo format, rather than ESRI? default=TRUE

layer

If the format is mapInfo, the layer name also needs to be provided, default is NULL

tolerance

Numerical tolerance value to be used by the Douglas-Peuker algorithm (only if shapefile has not already loaded)

Value

list with two data frames: map and data; 'map' is a data set with geographic latitude and longitude, and a grouping variable to define each entity. The 'data' data set consists of demographic or geographic information for each electorate, such as size in square kilometers or corresponding state. Additionally, geographic latitude and longitude of the electorate's centroid are added.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Get electorate shapes in data.frame format

# Path to your shapefile
fl <- "local/path/to/shapefile.shp"

map_and_data16 <- get_electorate_shapes(path_to_shapefile = fl)

## End(Not run)

eechidna documentation built on Feb. 25, 2021, 5:08 p.m.