om_geo {onmaRg} | R Documentation |
Load OnMarg spatial data
Description
This function combines Public Health Ontario's Ontario Marginalization Index data with Statistics Canada's shape files to create an sf_object. The sf_object can be used for mapping with packages such as ggplot, and for spatial analysis.
Usage
om_geo(year, level, format, quiet_sf = FALSE)
Arguments
year |
Integer year of data to load. |
level |
The level of precision to load, this can be "DAUID", "CTUID", "CSDUID", "CCSUID", "CDUID", "CMAUID", "PHUUID", "LHINUID", or "LHIN_SRUID". |
format |
The format for the geographic object, this can be "sf" or "sp". |
quiet_sf |
Logical, whether or not to print a message after transforming geometry projection. |
Details
If a year or level is used that does not exist or is not implemented, an error message will be produced. If the geometry file is unable to be downloaded, an error message will be produced.
Value
A sf or sp object containing the Marginalization Index and geographic boundaries for every geographic identifier.
Examples
## Not run:
DA_2016_geo <- om_geo(2016, "DAUID", "sf")
## End(Not run)