R/census_regions.R
search_census_regions.RdRuns 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.
search_census_regions(searchterm, dataset, level = NA, ...)The term to search for e.g. "Victoria".
Search terms are case insensitive. If unable to find a given search term,
this function will suggest the correct spelling to use when possible.
The dataset to query for available regions, e.g.
"CA16".
One of NA, 'C', 'PR', 'CMA', 'CD', or 'CSD'.
If specified, only return variables of specified `level`.
Further arguments passed on to list_census_regions.
A census region list of the same format as `list_census_regions()` containing the matches.
if (FALSE) {
# 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")
}