| mn_match | R Documentation |
Converts any common way of writing a Mongolian place into its code: English spellings ("Khuvsgul", "Khovsgol", "Hovsgol"), Cyrillic, NSO statistical codes, ISO 3166-2 codes and P-codes. Names are compared through a normalised key, so spelling variants, case, punctuation and words such as "aimag", "province", "soum" or "district" do not matter. Values that still do not match are tried with a small edit distance.
mn_match(
x,
level = NULL,
within = NULL,
to = c("pcode", "name_en", "name_mn", "name_mns", "iso_code", "nso_code", "level",
"type"),
fuzzy = TRUE,
max_dist = NULL,
quiet = FALSE
)
x |
A character vector of names or codes (numbers and factors are converted to character). |
level |
The level(s) to search: |
within |
Restricts the search to units inside a parent, given as a
name or code. Use it to separate soums that share a name. Either a
single value or one value per element of |
to |
What to return: |
fuzzy |
If |
max_dist |
Maximum edit distance for fuzzy matching. |
quiet |
If |
A character vector the same length as x. Values that cannot
be matched, or that match several units, are NA and are listed in a
warning.
Other names and codes:
mn_codes(),
mn_translit()
mn_match(c("Khuvsgul", "Hovsgol", "\\u0425\\u04e9\\u0432\\u0441\\u0433\\u04e9\\u043b", "MN-041"))
# NSO statistical codes work too
mn_match(c("183", "511", "51107"), to = "name_en")
# Many soums share a name: say which aimag you mean
mn_match("Bayan-Uul", level = "soum", within = "Dornod")
# Khoroos are numbered within their district
mn_match("15-r khoroo", level = "bag", within = "Bayangol")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.