load_shapefile: Load shapefile of Australia into R

View source: R/shapefiles.R

load_shapefileR Documentation

Load shapefile of Australia into R

Description

This is only used to create the new electorate map data, for future years. Load shapefile into R as an sf (simple features) object, extract polygon information, thin polygon, fix any problematic polygons, and format variable names. "nat_map" and "nat_data" objects for every Australian federal election between 2001-2019 can be readily loaded from the package for analysis.

Usage

load_shapefile(path_to_shapeFile, tolerance = 0.001)

Arguments

path_to_shapeFile

path to object in local machine

tolerance

numerical tolerance value to be used by the Douglas-Peuker algorithm

Details

The function will take several minutes to complete.

Value

object of class SpatialPolygonsDataFrame

Examples

## Not run: 
# Load electorate shapefile into R

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

# Load
my_sF <- load_shapefile(fl)

## End(Not run)

ropenscilabs/eechidna documentation built on May 4, 2023, 6:51 a.m.