Learn R Programming

cancensus (version 0.4.8)

get_census_geometry: Deprecated, use `get_census` instead

Description

This function will be removed in future versions.

Usage

get_census_geometry(dataset, regions, level = NA, geo_format = "sf", ...)

Arguments

dataset

A CensusMapper dataset identifier.

regions

A named list of census regions to retrieve. Names must be valid census aggregation levels.

level

The census aggregation level to retrieve, defaults to "Regions". One of "Regions", "PR", "CMA", "CD", "CSD", "CT" or "DA".

geo_format

By default is set to NA and appends no geographic information. To include geographic information with census data, specify one of either "sf" to return an sf object (requires the sf package) or "sp" to return a SpatialPolygonsDataFrame-class object (requires the rgdal package).

...

Further arguments passed to get_census.

Examples

Run this code
# NOT RUN {
# Query the API for data geographies in Vancouver, at the census subdivision
# level:
# }
# NOT RUN {
# Query the API for geographies in Vancouver, at the census subdivision
# level, and return the associated geography files in \code{sf} format:
census_data <- get_census(dataset='CA16', regions=list(CMA="59933"),
                          level='CSD', geo_format = "sf")
# }

Run the code above in your browser using DataLab