This function queries the dimension endpoint: https://data.statistics.sk/api/v2/dimension/<table_code>/<dimension_code>?lang=<lang> for a given table code and dimension code, returning a tibble with all possible values (element codes and labels) for that dimension.

susr_dimension_values(table_code, dimension_code, lang = "en")

Arguments

table_code

A string with the table code (e.g. "as1001rs"). This is the 8-character (or similar) code identifying the data cube.

dimension_code

A string with the dimension code (e.g. "as1001rs_rok").

lang

A string specifying the language code, either "en" or "sk". Defaults to "en".

Value

A tibble with columns:

dimension_code

The provided dimension code (e.g. "as1001rs_rok").

dimension_label

A short label for the dimension (if available).

dimension_note

A more descriptive note for the dimension (if available).

element_index

Index of each element.

element_value

Each possible value code (e.g. "2016", "SK021", etc.).

element_label

A descriptive label for each element code (if available).

Examples

if (FALSE) { # \dontrun{
# For table code "as1001rs" and dimension "as1001rs_rok":
dim_vals <- susr_dimension_values("as1001rs", "as1001rs_rok")
head(dim_vals)
} # }