Learn R Programming

restatapi (version 0.24.2)

search_eurostat_toc: Search for pattern in the titles, units and short description of the TOC

Description

Lists names of dataset from Eurostat with the particular pattern in the title, units or short description.

Usage

search_eurostat_toc(pattern, lang = "en", verbose = FALSE, ...)

Value

A table with the following columns:

titleThe name of dataset/table in the language provided by the lang parameter
codeThe codename of dataset/table which can be used by the get_eurostat function
typeThe type of information: 'dataset' or 'table'
lastUpdateThe date when the data was last time updated for tables and datasets
lastModifiedThe date when the structure of the dataset/table was last time modified
dataStartThe start date of the data in the dataset/table
dataEndThe end date of the data in the dataset/table
valuesThe number of values in the dataset/table
unitThe unit name for tables in the language provided by the lang parameter, if the type 'dataset' this column is empty
shortDescriptionThe short description of the values for tables in the language provided by the lang parameterif the type 'dataset' this column is empty
metadata.htmlThe link to the metadata in html format
metadata.sdmxThe link to the metadata in SDMX format
downloadLink.tsvThe link to the whole dataset/table in tab separated values format in the bulk download facility

The value in the code column can be used as an id in the get_eurostat_data, get_eurostat_bulk, get_eurostat_raw and get_eurostat_dsd functions. If there is no hit for the search query, it returns NULL.

Arguments

pattern

Character string to search for in the table of contents of Eurostat tables/datasets

lang

a character string either en, de or fr to define the language version for the table of contents. The default is en - English.

verbose

A boolean with default FALSE, so detailed messages (for debugging) will not printed. Can be set also with options(restatapi_verbose=TRUE)

...

other additional parameters to pass to the grepl function like ignore.case=TRUE if the pattern should be searched case sensitive or not. The default value for ignore.case is FALSE.

Details

Downloads the list of all tables and datasets available in the Eurostat database and returns all the details from the table of contents of the tables/datasets that contains particular pattern in the dataset title, unit or short description. E.g. all tables/datasets mentioning 'energy'.

See Also

search_eurostat_dsd, get_eurostat_data, get_eurostat_toc

Examples

Run this code
# \dontshow{
if (parallel::detectCores()<=2){
   options(restatapi_cores=1)
}else{
   options(restatapi_cores=2)
}    
# }
# \donttest{
if (!(grepl("amzn|-aws|-azure ",Sys.info()['release']))) options(timeout=2)
head(search_eurostat_toc("energy",verbose=TRUE))
nrow(search_eurostat_toc("energy"))
head(search_eurostat_toc("energie",lang="de",ignore.case=TRUE))
nrow(search_eurostat_toc("energie",lang="de",ignore.case=TRUE))
options(timeout=60)
# }

Run the code above in your browser using DataLab