R/shapefiles.R
get_electorate_shapes.Rd
This function is only used to create new map data in future elections 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 may take several minutes to complete.
get_electorate_shapes(
path_to_shapeFile = NULL,
sF = NULL,
mapinfo = TRUE,
layer = NULL,
tolerance = 0.001
)
path to object in local machine (only if shapefile has not already loaded)
Shapefile object loaded to environment using load_shapefile
Is the data mapInfo format, rather than ESRI? default=TRUE
If the format is mapInfo, the layer name also needs to be provided, default is NULL
Numerical tolerance value to be used by the Douglas-Peuker algorithm (only if shapefile has not already loaded)
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.
if (FALSE) {
# 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)
}