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

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

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.

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.

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'.

Examples

# \donttest{
if (!(grepl("amzn|-aws|-azure ",Sys.info()['release']))) options(timeout=2)
head(search_eurostat_toc("energy",verbose=TRUE))
#> 
#> get_eurostat_toc - API version:2 - number of cores:2
#> get_eurostat_toc - Downloading https://ec.europa.eu/eurostat/api/dissemination/catalogue/toc/xml
#> get_eurostat_toc - class(xml_leafs): xml_nodeset
#> get_eurostat_toc - number of nodes: 9688
#> get_eurostat_toc - number of cores: 2
#> get_eurostat_toc - The TOC was cached in memory ('toc.xml.en' in '.restatapi_env').
#>                                                                                                                           title
#>                                                                                                                          <char>
#> 1:                                                                                           Final energy consumption by sector
#> 2:                                                                                                    Primary energy production
#> 3:                                                                                 Secondary energy production (transformation)
#> 4:                                                                                    Core inflation differential vis-à-vis  EA
#> 5:            Psychological well-being (energy and vitality index) by sex, age and educational attainment level (average score)
#> 6: Persons heating their dwelling with district heating by used energy source, household composition and degree of urbanisation
#>               code    type lastUpdate lastModified dataStart dataEnd values
#>             <char>  <char>     <char>       <char>    <char>  <char>  <num>
#> 1: enps_nrg_bal_c1 dataset 2024.02.26   2024.02.26      2005    2022    329
#> 2:        med_eg10 dataset 2020.05.28   2024.01.10      2005    2018    391
#> 3:        med_eg20 dataset 2016.10.28   2024.01.10      2000    2015    776
#> 4:        tipscp10   table 2024.09.18   2024.09.18      2002    2023    638
#> 5:   hlth_ehis_st8 dataset 2014.03.20   2023.12.21      2008    2008   1455
#> 6:      ilc_lvhe04 dataset 2024.09.12   2024.09.12      2023    2023   8701
#>      unit
#>    <char>
#> 1:       
#> 2:       
#> 3:       
#> 4:       
#> 5:       
#> 6:       
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        shortDescription
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <char>
#> 1:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
#> 2:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
#> 3:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
#> 4: <p>The core inflation differential vis-à-vis the euro zone is an annual data indicator measuring the HICP annual average rate of change of the TOT_X_NRG_FOOD (all-items excluding energy, food, alcohol and tobacco) aggregate of the EU member states in comparison to the euro area. </p><p>It is calculated in percentage points by subtracting the euro area annual average TOT_X_NRG_FOOD rate of change from the one of the respective member state. It is also measured for the European fixed country composition aggregates – EU27 and EA20 – being by definition equal to 0.0 for the latter.</p><p>The data source is the HICP annual dataset (prc_hicp_aind).</p><p><br></p><p><br></p>
#> 5:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
#> 6:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
#>                                                        metadata.html
#>                                                               <char>
#> 1:     https://ec.europa.eu/eurostat/cache/metadata/en/enps_esms.htm
#> 2:      https://ec.europa.eu/eurostat/cache/metadata/en/med_esms.htm
#> 3:      https://ec.europa.eu/eurostat/cache/metadata/en/med_esms.htm
#> 4:                                                              <NA>
#> 5: https://ec.europa.eu/eurostat/cache/metadata/en/hlth_det_esms.htm
#> 6:  https://ec.europa.eu/eurostat/cache/metadata/en/ilc_sieusilc.htm
#>                                                                                 metadata.sdmx
#>                                                                                        <char>
#> 1:     https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/enps_esms.sdmx.zip
#> 2:      https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/med_esms.sdmx.zip
#> 3:      https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/med_esms.sdmx.zip
#> 4:                                                                                       <NA>
#> 5: https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/hlth_det_esms.sdmx.zip
#> 6:  https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/ilc_sieusilc.sdmx.zip
#>                                                                                            downloadLink.tsv
#>                                                                                                      <char>
#> 1: https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/ENPS_NRG_BAL_C1?format=tsv&compressed=true
#> 2:        https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/MED_EG10?format=tsv&compressed=true
#> 3:        https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/MED_EG20?format=tsv&compressed=true
#> 4:        https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/TIPSCP10?format=tsv&compressed=true
#> 5:   https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/HLTH_EHIS_ST8?format=tsv&compressed=true
#> 6:      https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/ILC_LVHE04?format=tsv&compressed=true
nrow(search_eurostat_toc("energy"))
#> [1] 113
head(search_eurostat_toc("energie",lang="de",ignore.case=TRUE))
#>                                                                    title
#>                                                                   <char>
#> 1:                                            Energie - monatliche Daten
#> 2:                                                         Energiebilanz
#> 3:                                       Endenergieverbrauch nach Sektor
#> 4: Energie - historische daten (2004-2007, ehemalige Methode und Quelle)
#> 5:                                               Primäre Energierzeugung
#> 6:                                 Sekundäre Energierzeugung (Umsetzung)
#>               code    type lastUpdate lastModified dataStart dataEnd values
#>             <char>  <char>     <char>       <char>    <char>  <char>  <num>
#> 1:       ei_isen_m   table 2024.09.27   2024.09.27   2008-01 2024-08  79809
#> 2:  enps_nrg_bal_c dataset 2024.02.26   2024.02.26      2005    2022    693
#> 3: enps_nrg_bal_c1 dataset 2024.02.26   2024.02.26      2005    2022    329
#> 4:      med_eg_all dataset 2014.12.08   2023.12.21      1990    2011    935
#> 5:        med_eg10 dataset 2020.05.28   2024.01.10      2005    2018    391
#> 6:        med_eg20 dataset 2016.10.28   2024.01.10      2000    2015    776
#>      unit shortDescription
#>    <char>           <char>
#> 1:                        
#> 2:                        
#> 3:                        
#> 4:                        
#> 5:                        
#> 6:                        
#>                                                     metadata.html
#>                                                            <char>
#> 1: https://ec.europa.eu/eurostat/cache/metadata/en/ei_is_esms.htm
#> 2:  https://ec.europa.eu/eurostat/cache/metadata/en/enps_esms.htm
#> 3:  https://ec.europa.eu/eurostat/cache/metadata/en/enps_esms.htm
#> 4:   https://ec.europa.eu/eurostat/cache/metadata/en/med_esms.htm
#> 5:   https://ec.europa.eu/eurostat/cache/metadata/en/med_esms.htm
#> 6:   https://ec.europa.eu/eurostat/cache/metadata/en/med_esms.htm
#>                                                                              metadata.sdmx
#>                                                                                     <char>
#> 1: https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/ei_is_esms.sdmx.zip
#> 2:  https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/enps_esms.sdmx.zip
#> 3:  https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/enps_esms.sdmx.zip
#> 4:   https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/med_esms.sdmx.zip
#> 5:   https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/med_esms.sdmx.zip
#> 6:   https://ec.europa.eu/eurostat/api/dissemination/files?file=metadata/med_esms.sdmx.zip
#>                                                                                            downloadLink.tsv
#>                                                                                                      <char>
#> 1:       https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/EI_ISEN_M?format=tsv&compressed=true
#> 2:  https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/ENPS_NRG_BAL_C?format=tsv&compressed=true
#> 3: https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/ENPS_NRG_BAL_C1?format=tsv&compressed=true
#> 4:      https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/MED_EG_ALL?format=tsv&compressed=true
#> 5:        https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/MED_EG10?format=tsv&compressed=true
#> 6:        https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/MED_EG20?format=tsv&compressed=true
nrow(search_eurostat_toc("energie",lang="de",ignore.case=TRUE))
#> [1] 123
options(timeout=60)
# }