| mn_bags | R Documentation |
Bags (baga) are the subdivisions of soums; there are about 1,650 of them.
Their codes and names are built in (see mn_codes("bag")), but their
boundaries are not openly published: the National Statistics Office of
Mongolia (NSO) shares them on request. Once you have a bag boundary file,
mn_bags() and every other function in the package can use it.
mn_bags(
aimag = NULL,
soum = NULL,
path = getOption("mongolmaps.bags_path"),
resolution = c("low", "high"),
lang = NULL,
crs = NULL
)
mn_read_bags(path, code_col = NULL, check_nesting = TRUE)
aimag, soum |
Keep only bags in these aimags or soums (names or codes). |
path |
Path to a bag boundary file readable by |
resolution |
|
lang |
Language of the |
crs |
Coordinate reference system of the result. |
code_col |
Name of the column holding bag codes: 7-digit NSO codes
( |
check_nesting |
If |
An sf tibble; see mn_admin() for the columns.
Write to NSO (international@nso.mn) and ask for the bag boundaries as a
shapefile or GeoPackage, with each bag's NSO code. Then either pass the
file to mn_bags(path = ...), or register it once per session with
options(mongolmaps.bags_path = "path/to/bags.gpkg") (put that line in
your .Rprofile to make it permanent). Registered bags are also returned
by mn_admin("bag") and used by mn_join().
mn_read_bags() checks the file: every bag must have a known code and
sit inside its soum.
Other admin boundaries:
mn_admin(),
mn_aimags(),
mn_country(),
mn_soums(),
mn_ub()
# Codes and names of all bags, without boundaries:
mn_codes("bag", within = "Khovd")
# Without a bag boundary file, mn_bags() explains how to get one:
try(mn_bags())
# With the file from NSO (not run, as the file is not public):
## Not run:
mn_bags(aimag = "Khovd", path = "bags_from_nso.gpkg")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.