sdmx_ilostat: Read Ilostat Data, Metadata via ILO SDMX api

Description Usage Arguments Author(s) References Examples

View source: R/sdmx_ilostat.R

Description

query codelist, data and metadata via ilo sdmx api

Usage

1
2
3
4
5
6
7
8
sdmx_ilostat(
  dsd,
  sdmx_resource = getOption("ilostat_sdmx_resource", "codelist"),
  sdmx_format = "csv",
  lang = getOption("ilostat_lang", "en"),
  count = getOption("ilostat_sdmx_count", FALSE),
  quiet = getOption("ilostat_quiet", FALSE)
)

Arguments

dsd

A datastructure definition, see examples section,

sdmx_resource

: a character, type of info to be returned from the sdmx api: 'codelist' (default), 'data', 'dataflow', 'conceptref',

sdmx_format

: for data only, a character, format of info to be returned from the sdmx api: 'csv' (default) others no longer available.

lang

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

count

a logical, count data records only if resource = 'data', FALSE (default),

quiet

a logical, if TRUE , don't return message from processing, FALSE (default). Can be set also with options(ilostat_quiet = TRUE).

Author(s)

David Bescond bescond@ilo.org

References

See citation("Rilostat")

ilostat sdmx user guidelines: "https://www.ilo.org/ilostat-files/Documents/SDMX_User_Guide.pdf"

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
## Not run: 
########## get codelist
# fetch indicator define on ILOSTAT
 dic <- sdmx_ilostat(dsd = "CL_INDICATOR", lang ="en")
 head(dic)

# fetch country available on ILOSTAT
 dic <- sdmx_ilostat(dsd = "CL_AREA", lang ="es")
 head(dic)

# fetch classif ECO version available on ILOSTAT
 dic <- sdmx_ilostat(dsd = "CL_ECO", lang ="en")
 head(dic)

# fetch note type available on ILOSTAT
 dic <- sdmx_ilostat(dsd = "CL_NOTE_TYPE", lang ="en")
 head(dic)

# fetch note "Repository" available on ILOSTAT
 dic <- sdmx_ilostat(dsd = "CL_NOTE_R1", lang ="en")
 head(dic)

########## get data

### with attribute
 dat <- sdmx_ilostat(dsd = 'STI_ALB_EMP_TEMP_SEX_AGE_NB', 
                    sdmx_resource = 'data')
 head(dat)

# without attribute
 dat <- sdmx_ilostat(dsd = "STI_DEU_EMP_TEMP_SEX_AGE_NB?detail=dataonly", 
                    sdmx_resource = 'data')
 head(dat)

######## with multi country and advanced filters

# to get the order of the filter first get the conceptref of the DSD

 filter_position <- sdmx_ilostat(dsd = 'STI_ALL_EMP_TEMP_SEX_AGE_NB', 
 				   sdmx_resource = 'conceptref')
 filter_position

# COUNTRY and FREQ are in second and third position of the filters

 dat <- sdmx_ilostat(dsd = "STI_ALL_EMP_TEMP_SEX_AGE_NB/.FRA+DEU.Q....", 
                    sdmx_resource = 'data')
 head(dat)

########## dataflow available

 flow <- sdmx_ilostat("STI_TTO_MULTI", sdmx_resource = 'dataflow')

 flow <- sdmx_ilostat("KI_ALL_EMP_MULTI", sdmx_resource = 'dataflow')

 flow <- sdmx_ilostat("YI_FRA_UNE_MULTI", sdmx_resource = 'dataflow')

########## count data available

 sdmx_ilostat("STI_FRA_UNE_TUNE_SEX_AGE_NB/STI.FRA.....", 
                     sdmx_resource = 'data', count = TRUE)


## End(Not run)

Rilostat documentation built on July 29, 2021, 9:07 a.m.