An open API service indexing awesome lists of open source software.

https://github.com/temuulene/mongolstats

Tidy access to Mongolian NSO Open Data and admin boundaries
https://github.com/temuulene/mongolstats

api mongolia nso opendata r r-package rstats

Last synced: 9 months ago
JSON representation

Tidy access to Mongolian NSO Open Data and admin boundaries

Awesome Lists containing this project

README

          

---
output: github_document
---

# mongolstats

Tidy access to the National Statistics Office of Mongolia (NSO) statistics via the PXWeb API (data.1212.mn) and Mongolia administrative boundaries, inspired by tidycensus.

## Installation

`
# install.packages("devtools")
devtools::install_github("temuulene/mongolstats")
`

## Quick start

`
library(mongolstats)
library(dplyr)

# Use PXWeb API (data.1212.mn)
nso_options(mongolstats.lang = "en")

# List available tables
itms <- nso_itms()
itms %>% select(tbl_id, tbl_eng_nm, strt_prd, end_prd) %>% slice_head(n = 5)

# Inspect variables (codebook) for a table
vars <- nso_itms_detail("DT_NSO_0300_001V2")
vars %>% count(field)

# Fetch data
dat <- nso_data(
tbl_id = "DT_NSO_0300_001V2",
selections = list(Sex = "Total", Age = "Total", Year = "2024")
)
dat %>% slice_head(n = 6)
`