View source: R/set_region_codes.R
match_region_codes | R Documentation |
Given a region code in "nonstandard" format, matches all "standardized" region codes that it could denote. Works by first reducing the region code to a double and then matching all region codes of all region levels that when reduced to double are the same.
match_region_codes(
x,
year = NULL,
region_level = NULL,
offline = TRUE,
use_char_length_info = NULL
)
match_region_codes_internal(
x,
key,
region_level = NULL,
use_char_length_info = NULL
)
x |
input code |
year |
double, year of classification |
region_level |
character (vector) region level of the input codes |
offline |
logical, whether works offline with package data. Defaults to |
use_char_length_info |
TRUE or named vector, whether to use code character length
information in determining their region level. Defaults to |
If given a region code in "standardized" format, returns the input as such. That is, region codes in standardized format have unique matches.
By setting year
you can restrict the domain of potential matches to region
codes in use in specific year. When year
is not set, latest classifications
are used.
By setting region_level
you can restrict the domain of potential matches
to specific region levels.
vector
match_region_codes_internal()
: Match single region code. For internal use.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.