get_eurostat_toc {restatapi} | R Documentation |
Download the Table of Contents of Eurostat datasets
Description
Download Table of Contents (TOC) of Eurostat datasets if it is not cached previously.
Usage
get_eurostat_toc(
mode = "xml",
cache = TRUE,
update_cache = FALSE,
cache_dir = NULL,
compress_file = TRUE,
lang = "en",
verbose = FALSE,
...
)
Arguments
mode |
a character string either |
cache |
a boolean whether to load/save the TOC from/in the cache or not. The default value is |
update_cache |
a boolean to update cache or not. The default value is |
cache_dir |
a path to a cache directory. The default is |
compress_file |
a logical whether to compress the RDS-file in caching. Default is |
lang |
a character string either |
verbose |
A boolean with default |
... |
parameter to pass on the |
Details
The TOC is downloaded from Eurostat websites through the REST API for the xml
(default) version or from the bulk download facilities for txt
version.
From the downloaded TOC the values in the 'code' column can be used as id
in the get_eurostat_dsd
, get_eurostat_raw
, get_eurostat_bulk
, and get_eurostat_data
functions.
Value
A data table with the following columns:
title | The name of dataset/table in the language provided by the lang parameter |
code | The codename of dataset/table which can be used as id in other functions |
type | The type of information: 'dataset' or 'table' |
lastUpdate | The date when the data was last time updated for tables and datasets |
lastModified | The date when the structure of the dataset/table was last time modified |
dataStart | The start date of the data in the dataset/table |
dataEnd | The end date of the data in the dataset/table |
values | The number of values in the dataset/table, and it is filled only if the download
mode is "xml" |
unit | The unit name for tables in the language provided by the lang parameter, for
dataset it is empty and this column exists only if the download mode is "xml" |
shortDescription | The short description of the values for tables in the language provided by the
lang parameter, for dataset it is empty and this column exists only if the download mode is "xml" |
metadata.html | The link to the metadata in html format, and this column exists only if the
download mode is "xml" |
metadata.sdmx | The link to the metadata in SDMX format, and this column exists only if the
download mode is "xml" |
downloadLink.tsv | The link to the whole dataset/table in tab separated values format in the bulk
download facility and this column exists only if the download mode is "xml"
|
References
For more technical information see the detailed documentation of the API.
See Also
search_eurostat_toc
, get_eurostat_dsd
, get_eurostat_raw
, get_eurostat_bulk
, get_eurostat_data
.
Examples
if (!(grepl("amzn|-aws|-azure ",Sys.info()['release']))) options(timeout=2)
toc_xml<-get_eurostat_toc(cache=FALSE,verbose=TRUE)
head(toc_xml)
toc_txt<-get_eurostat_toc(mode="txt", lang="de")
head(toc_txt)
options(timeout=60)