search_census_regions {cancensus} | R Documentation |
Query the CensusMapper API for regions with names matching a searchterm.
Description
Runs a query against the CensusMapper API to retrieve region data with
names matching specific queries. Users can optionally specify the target geography level
(e.g. level = 'CMA'
, level = 'CSD'
, etc.). Alternatively, calling
explore_census_vectors()
will launch the interactive region selection tool on
the CensusMapper site in a new web page or tab.
Usage
search_census_regions(searchterm, dataset, level = NA, ...)
Arguments
searchterm |
The term to search for e.g. |
dataset |
The dataset to query for available regions, e.g.
|
level |
One of |
... |
Further arguments passed on to |
Value
A census region list of the same format as 'list_census_regions()' containing the matches.
Examples
## Not run:
# This will return a warning that no match was found, but will suggest similar named regions.
search_census_regions('Victorea', 'CA16')
# This will limit region results to only include CMA level regions
search_census_regions('Victoria', 'CA16', level = "CMA")
## End(Not run)