add_unique_names_to_region_list: Convenience function for creating unique names from region...

View source: R/census_regions.R

add_unique_names_to_region_listR Documentation

Convenience function for creating unique names from region list

Description

Names of municipalities are not always unique, especially at the CSD level. This function takes as input a subset of a regions list as generated from 'list_census_regions()' and de-duplicates names as needed by adding the municipal status in parenthesis. If this does not de-duplicate the name then the geographic identifier will be further added in parenthesis behind that.

Usage

add_unique_names_to_region_list(region_list)

Arguments

region_list

a subset of a regions list as gotten from 'list_census_regions()'

Value

The same list of regions with an extra column 'Name' with de-duplicated names.

Examples

## Not run: 
# This will return a warning that no match was found, but will suggest similar named regions.
library(dplyr)
list_census_regions("CA21") %>%
  filter(level=="CSD", CMA_UID=="59933") %>%
  add_unique_names_to_region_list()

## End(Not run)

cancensus documentation built on May 29, 2024, 6:21 a.m.