| sidra_metadata | R Documentation |
Normalizes the official version 3 metadata and period responses into a stable collection of base data frames.
sidra_metadata(
table,
refresh = FALSE,
cache = FALSE,
ttl = 1800,
cache_dir = NULL
)
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 |
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 |
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.
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.
Renato Prado Siqueira rpradosiqueira@gmail.com
sidra_catalog(), sidra_periods(), sidra_locations()
Other SIDRA discovery functions:
sidra_catalog(),
sidra_locations(),
sidra_periods()
## Not run:
metadata <- sidra_metadata(7060)
metadata$variables
metadata$geographies
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.