Skip to contents

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())

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.

Value

An object of class nso_query.

Examples

# Create a query object (does not require network)
q <- nso_query("DT_NSO_0300_001V2", list(Year = "2023", Sex = "Total"))
print(q)
#> <nso_query>
#>   tbl_id    : DT_NSO_0300_001V2
#>   selections: 2 dimensions
#>     - Year: 2023
#>     - Sex: Total