get_ilostat_toc: Read Ilostat Table of Contents

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/get_ilostat_toc.R

Description

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

Usage

1
2
3
4
5
6
7
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://www.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://www.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.

The TOC in English by modelled_estimates is downloaded from https://www.ilo.org/ilostat-files/WEB_bulk_download/modelled_estimates/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

Author(s)

David Bescond bescond@ilo.org

References

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

See Also

get_ilostat.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## 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)

Rilostat documentation built on July 8, 2020, 7:02 p.m.