Download Data Structure Definition (DSD) of a Eurostat dataset if it is not cached previously.
get_eurostat_dsd(id, cache = TRUE, update_cache = FALSE,
cache_dir = NULL, compress_file = TRUE, verbose = FALSE, ...)
a character string with the id of the dataset. It is the value from the codename column of the get_eurostat_toc
function.
a boolean whether to load/save the TOC from/in the cache or not. The default value is TRUE
, so that the TOC is checked first in the cache and if does not exist then downloaded from Eurostat and cached.
a boolean to update cache or not. The default value is FALSE
, so the cache is not updated. Can be set also with options(restatapi_update=TRUE)
a path to a cache directory. The default is NULL
, in this case the TOC is cached in the memory (in the '.restatapi_env'). Otherwise if the cache_dir
directory does not exist it creates the 'restatapi' directory in the temporary directory from tempdir()
to save the RDS-file. Directory can also be set with option(restatapi_cache_dir=...)
.
a logical whether to compress the RDS-file in caching. Default is TRUE
.
A boolean with default FALSE
, so detailed messages (for debugging) will not printed.
Can be set also with options(restatapi_verbose=TRUE)
parameter to pass on the load_cfg
function
If the DSD does not exist it returns NULL
otherwise the result is a table with the 3 columns:
concept |
The name of the concepts in the order of the data structure |
code |
The possible list of codes under the concept |
The DSD is downloaded from Eurostat's website, through the REST API in XML (SDMX) format.
For more information see the detailed documentation of the API.
# NOT RUN {
dsd<-get_eurostat_dsd("nama_10_gdp",cache=FALSE,verbose=TRUE)
head(dsd)
# }
Run the code above in your browser using DataLab