| oecdDataset | R Documentation |
Resolve a readable dataset code, optional identity selectors and its structure version without downloading observations.
oecdDataset(OECDDatasetCode, agency = NULL, prefix = NULL, version = NULL)
OECDDatasetCode |
A short code, a complete dataflow ID, or a reference
|
agency |
Optional single agency identifier, for example |
prefix |
Optional dataflow namespace prefix before |
version |
Optional numeric version string, |
This is a package-level convenience, not a different OECD API. For unqualified
input, matching is case-insensitive and follows three levels: complete dataflow
ID, terminal ID after the last @, then that terminal ID with a leading
DF_ removed. The first non-empty level is used. No fuzzy matching,
legacy-code translation or hard-coded alias table is used.
Selectors restrict the catalogue before matching. If the chosen level contains
more than one agency/dataflow identity, an OECDdata_ambiguous error lists
canonical candidates and carries their complete rows in candidates.
Use the agency or prefix selector, or a canonical reference. Selectors that
conflict with an explicitly qualified reference are errors, not overrides.
importDataList advertises a ShortCode only if it cannot collide
with any other identity's literal, terminal or compact code. Otherwise that
column is missing. A short code can become ambiguous after catalogue changes;
store this function's canonical result for repeatable dataset selection.
A qualified reference bypasses the catalogue, but its structure is still fetched or read from a verified cache. Offline shorthand resolution needs a cached catalogue in addition to cached structure/data responses. This function fetches structure metadata and dictionaries, but never observations. Returned structure versions do not freeze future observation revisions.
importData and oecdQuery also accept these selectors in a reserved
filters = list(.dataset = list(agency = ..., prefix = ..., version = ...),
REF_AREA = ...) block. Dataset selectors are removed before building observation
filters. A block containing only dataset selectors leaves all dimensions
unrestricted. Metadata functions accept this function's returned reference.
One character string containing the canonical, fully qualified
"AGENCY,DATAFLOW,VERSION" reference with an exact resolved version.
importData, importDataList, oecdQuery, oecdStructure
if (interactive()) {
ref <- oecdDataset("CLI", agency = "OECD.SDD.STES", prefix = "DSD_STES")
s <- oecdStructure(ref)
importLabels(OECDDimCode = "REF_AREA", dataset = ref)
q <- oecdQuery("CLI", filters = list(
.dataset = list(agency = "OECD.SDD.STES"),
REF_AREA = "USA", FREQ = "M", TIME_PERIOD = c("2023-01", "2023-12")))
attr(q, "OECDDatasetCode")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.