load_format_spatial_polys: Load and format spatial polygons for modeling

Description Usage Arguments Value

View source: R/spatial_data_functions.R

Description

Load a spatial polygons object in SF format, assign location codes based on each province abbreviation, and return polygons objects in both SF and SP formats

Usage

1
load_format_spatial_polys(shp_in_fp, abbrev_field, location_table)

Arguments

shp_in_fp

Input filepath to a spatial object (usually a shapefile)

abbrev_field

Field listing two-character province abbreviations

location_table

Data.frame listing province information. Should contain at least the following fields: - 'abbrev': Two-character province abbreviations (eg 'TO', 'VC') - 'location_code': Province codes that will be assigned to the spatial polygons object

Value

List with two items: - 'shp_sf': Formatted spatial polygons, in SF format - 'shp_sp': Formatted spatial polygons, in SP format


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.