Fetch statistical data for a table (PXWeb)
Arguments
- tbl_id
Table identifier (e.g., "DT_NSO_0300_001V2").
- selections
Named list mapping variable labels (e.g., Year, Sex) to desired codes or labels.
- labels
Label handling: "none" (codes only), "en", "mn", or "both".
- value_name
Name of the numeric value column in the result (default: "value").
- include_raw
If TRUE, attach the raw PX payload as attribute
px_raw.
Table Structure Notes
Some NSO tables have unique dimension structures that affect how selections
should be constructed:
Air Quality Monthly Tables (e.g.,
DT_NSO_2400_015V1toV6): These tables do not have aYeardimension. Instead, they use a runningMonthdimension with integer codes (e.g.,"0"for the most recent month). Example:selections = list(Month = as.character(0:11))retrieves the last 12 months.
