sidra_metadata: Retrieve structured SIDRA table metadata

View source: R/discovery.R

sidra_metadataR Documentation

Retrieve structured SIDRA table metadata

Description

Normalizes the official version 3 metadata and period responses into a stable collection of base data frames.

Usage

sidra_metadata(
  table,
  refresh = FALSE,
  cache = FALSE,
  ttl = 1800,
  cache_dir = NULL
)

Arguments

table

A single SIDRA table code.

refresh

A single logical value. When caching is enabled, bypass and replace an existing entry.

cache

A single logical value. Cache normalized catalog or metadata responses on disk. The default is FALSE, preserving live behavior.

ttl

A positive cache lifetime in seconds. The default is 30 minutes.

cache_dir

Optional cache directory. By default, the platform-specific user cache directory for sidrar is used.

Details

sidra_metadata() requests both the table metadata endpoint and the table-specific period endpoint. This makes periods equivalent to sidra_periods() and keeps the table's complete period inventory separate from its frequency and first/last-period summary. Within each classification, category_order is the one-based order in the official response. Together with level, it preserves the API's hierarchical preorder; categories are deliberately not sorted by identifier.

Value

A named list with six data frames. table contains table_id, table_name, research_name, subject, url, frequency, period_start, and period_end. periods has the schema documented by sidra_periods(). variables contains table_id, variable_id, variable_name, unit, and the character list-column summarized_by. classifications contains table_id, classification_id, classification_name, summarizable, and the character list-column summarization_exceptions. categories contains table_id, classification_id, category_id, category_name, unit, level, and category_order. geographies contains table_id, group, and level_id. All API identifiers are character vectors; no raw JSON object is exposed.

Author(s)

Renato Prado Siqueira rpradosiqueira@gmail.com

See Also

sidra_catalog(), sidra_periods(), sidra_locations()

Other SIDRA discovery functions: sidra_catalog(), sidra_locations(), sidra_periods()

Examples

## Not run: 
metadata <- sidra_metadata(7060)
metadata$variables
metadata$geographies

## End(Not run)

sidrar documentation built on Sept. 18, 2026, 9:14 a.m.