load_shapefile: Load shapefile of Australia into R

Description Usage Arguments Details Value Examples

View source: R/shapefiles.R

Description

Load shapefile into R as a SpatialDataFrame, 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-2016 can be readily loaded from the package for analysis.

Usage

1
load_shapefile(path_to_shapeFile, tolerance = 0.005)

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

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