mn_codes: Codes and names of Mongolian administrative units

View source: R/codes.R

mn_codesR Documentation

Codes and names of Mongolian administrative units

Description

Returns the table behind every map in the package: one row per unit, from the country down to bags and khoroos, with its codes, names and place in the hierarchy. Use it to look up codes, to build your own crosswalks, or to see which units have a boundary.

Usage

mn_codes(level = NULL, within = NULL, aliases = FALSE, lang = NULL)

Arguments

level

Levels to return (see mn_match()); NULL returns all.

within

Keep only units inside this parent (a name or code).

aliases

If TRUE, return one row per known spelling of each unit (the table used by mn_match()) instead of one row per unit.

lang

Language of the name column: "en" (English, as in NSO tables), "mn" (Cyrillic) or "mns" (Latin with diacritics). Defaults to getOption("mongolmaps.lang", "en").

Details

Units are identified by pcode, a code that is unique across levels:

  • "MN" for the country, "MNR1" to "MNR5" for the economic regions (Western, Khangai, Central, Eastern, Ulaanbaatar);

  • "MN" + the two-digit NSO aimag code for aimags ("MN84" Khovd, "MN11" Ulaanbaatar);

  • two more digits for soums and Ulaanbaatar districts ("MN8401"), and two more for bags and khoroos ("MN110751").

These match the P-codes of the humanitarian Common Operational Dataset and are the NSO statistical codes without their leading region digit (nso_code, as used in NSO PXWeb tables).

The type column separates units that share a level: "capital" (Ulaanbaatar) among aimags; "district" and "village" among soums; "khoroo" among bags. Villages (tosgon) and rural bags have codes and statistics but no boundary (has_geometry is FALSE).

Value

A tibble. With aliases = FALSE: the columns of every admin map (see mn_admin()) plus has_geometry. With aliases = TRUE: pcode, level, name_en, alias and source.

See Also

Other names and codes: mn_match(), mn_translit()

Examples

mn_codes("aimag")
mn_codes("soum", within = "Khovd")
mn_codes("aimag", aliases = TRUE)

mongolmaps documentation built on Oct. 10, 2026, 5:08 p.m.