importLabels: Import Dataset-Scoped Dimension or Attribute Labels

View source: R/structure.R

importLabelsR Documentation

Import Dataset-Scoped Dimension or Attribute Labels

Description

Import Dataset-Scoped Dimension or Attribute Labels.

Usage

importLabels(OECDDimCode, dataset = NULL)

importDimLabel(OECDDimCode, dataset = NULL)

Arguments

OECDDimCode

A component ID such as "REF_AREA". Without dataset context, a fully qualified codelist reference or a globally unambiguous CL_-prefixed codelist can be used. A single string of the form "AGENCY,DATAFLOW,VERSION::DIMENSION" also supplies context.

dataset

Optional dataset short code or canonical reference, as in oecdDataset. Defaults to the dataset option. Explicit dataset context is recommended because OECD codelist IDs need not be globally unique. A qualified component reference overrides the default option; an explicitly supplied dataset must resolve to the same dataset.

Details

Labels are resolved from the specific DSD, concept scheme and enumerated codelist, including agency and version. The requested language is preferred, then English, then the first available label. Ambiguous dictionaries cause an error rather than an arbitrary selection. Labels are permissible codes, not a claim that observations exist. A component without an enumerable dictionary can be passed to importDimLabel with dataset context to retrieve its name, but cannot be passed to importLabels. Use oecdDataset first when agency, prefix or version selectors are needed. Attributes identify the OECDDimCode, resolved OECDDatasetCode, and DownloadTime.

Value

importLabels returns a two-column data frame with classes OECDLabels and data.frame. The first column uses the component name supplied by the caller; the second appends _labels. Columns are factors by default. importDimLabel returns one character label.

See Also

oecdStructure, describe

Examples

if (interactive()) {
code <- "CLI"
importLabels("REF_AREA", dataset = code)
importDimLabel("REF_AREA", dataset = code)
old <- oecdOptions(dataset = code)
importLabels("FREQ")
options(old)
}

OECDdata documentation built on Oct. 31, 2026, 1:07 a.m.