get_ilostat_toc: Read Ilostat Table of Contents

View source: R/get_ilostat_toc.R

get_ilostat_tocR Documentation

Read Ilostat Table of Contents

Description

Download one table of contents from ilostat https://ilostat.ilo.org via bulk download facility https://ilostat.ilo.org/data/bulk/.

Usage

get_ilostat_toc(
  segment = getOption("ilostat_segment", "indicator"),
  lang = getOption("ilostat_lang", "en"),
  search = getOption("ilostat_search", "none"),
  filters = getOption("ilostat_filter", "none"),
  fixed = getOption("ilostat_fixed", TRUE)
)

Arguments

segment

A character, way to get datasets by: "indicator" (default) or "ref_area", Can be set also with options(ilostat_segment = 'ref_area'),

lang

a character, code for language. Available are "en" (default), "fr" and "es". Can be set also with options(ilostat_lang = 'fr'),

search

a character vector, "none" (default), datasets with this pattern in the description will be returned, characters vector will be use as AND, Character with '|' as OR, see example, options(ilostat_time_format = 'date'),

filters

a list; "none" (default) to get a whole toc or a named list of filters to get just part of the table. Names of list objects are ilostat toc variable codes and values are vectors of observation codes. filters detect on variables.

fixed

a logical, if TRUE (default), pattern is a string to be matched as is, Change to FALSE if more complex regex matching is needed.

Details

The TOC in English by indicator is downloaded from https://webapps.ilo.org/ilostat-files/WEB_bulk_download/indicator/table_of_contents_en.csv. The values in column 'id' should be used to download a selected dataset.

The TOC in English by ref_area is downloaded from https://webapps.ilo.org/ilostat-files/WEB_bulk_download/ref_area/table_of_contents_en.csv. The values in column 'id' should be used to download a selected dataset.

Value

A tibble with ten columns depending of the segment: indicator or ref_area

  • id : The codename of dataset of theme, will be used by the get_ilostat and get_ilostat_raw functions,

  • indicator or ref_area : The indicator or ref_area code of dataset,

  • indicator.label or ref_area.label : The indicator or ref_area name of dataset,

  • freq : The frequency code of dataset,

  • freq.label : Is freq name of dataset,

  • size : Size of the csv.gz files,

  • data.start : First time period of the dataset,

  • data.end : Last time period of the dataset,

  • last.update : Last update of the dataset,

  • ... : Others relevant information

Author(s)

David Bescond bescond@ilo.org

References

See citation("Rilostat") ilostat bulk download facility user guidelines https://webapps.ilo.org/ilostat-files/WEB_bulk_download/ILOSTAT_BulkDownload_Guidelines.pdf

See Also

get_ilostat.

Examples

## Not run: 
## default segment by indicator, default lang English
 toc <- get_ilostat_toc()
 head(toc)
 toc <- get_ilostat_toc(segment = 'ref_area', lang = 'fr')
 head(toc)
##
## search on toc
 toc <- get_ilostat_toc(search = 'education')
 head(toc)
 toc <- get_ilostat_toc(lang = 'fr', search = 'éducation')
 head(toc)
 toc <- get_ilostat_toc(segment = 'ref_area', lang = 'fr', search = 'Albanie')
 toc
 toc <- get_ilostat_toc(segment = 'ref_area', lang = 'es', search = 'Trimestral')
 head(toc)
##
## search multi on toc
 toc <- get_ilostat_toc(segment = 'ref_area', lang = 'fr', 
             search = 'Albanie|France', fixed = FALSE)
 head(toc)
 toc <- get_ilostat_toc(search = 'youth|adult', fixed = FALSE)
 head(toc)
 toc <- get_ilostat_toc(search = c('youth','adult'), fixed = FALSE)
 head(toc)
##

## End(Not run)

dbescond/Rilostat documentation built on Feb. 21, 2024, 9:31 p.m.