Learn R Programming

mongolstats (version 0.1.1)

nso_query: Create a PXWeb query object

Description

Builds a lightweight query object that records a table id and selections. Use nso_fetch() to execute it, or as_px_query() to inspect the underlying PXWeb body.

Usage

nso_query(tbl_id, selections = list())

Value

An object of class nso_query.

Arguments

tbl_id

Table identifier, e.g. "DT_NSO_0300_001V2".

selections

Named list mapping dimension labels (e.g., Year, Sex) to desired codes or labels.

Examples

Run this code
# Create a query object (does not require network)
q <- nso_query("DT_NSO_0300_001V2", list(Year = "2023", Sex = "Total"))
print(q)

Run the code above in your browser using DataLab