sdmx_ilostat: Read Ilostat Data, Metadata via ILO DSMX api

Description Usage Arguments Author(s) References Examples

Description

query codelist, data and metadata via ilo sdmx api

Usage

1
2
3
4
5
sdmx_ilostat(dsd, sdmx_resource = getOption("ilostat_sdmx_resource",
  "codelist"), sdmx_format = getOption("ilostat_sdmx_format", "compact_2_1"),
  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

: a character, format of info to be returned from the sdmx api: 'compact_2_1' (default), coming soon: 'generic_2_1', 'json',

lang

a character, code 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 [email protected]

References

See citation("Rilostat")

ilostat sdmx user guidelines: "http://www.ilo.org/ilostat/content/conn/ILOSTATContentServer/path/Contribution Folders/statistics/web_pages/static_pages/technical_page/ilostat_appl/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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
## Not run: 
########## get codelist
# fetch collection define on ILOSTAT
dic <- sdmx_ilostat(dsd = "CL_COLLECTION", lang ="en")
head(dic)

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

# fetch indicator define in collection STI
sdmx_ilostat(dsd = "CL_INDICATOR_STI", lang ="fr")
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')

# of last N data
dat <- sdmx_ilostat(dsd = "STI_ITA_EMP_TEMP_SEX_AGE_NB?lastNObservations=1",
                    sdmx_resource = 'data')
head(dat)

# of first N data
dat <- sdmx_ilostat(dsd = "STI_ARG_EMP_TEMP_SEX_AGE_NB?firstNObservations=2", 
                    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.M....", 
                    sdmx_resource = 'data')
head(dat)

# check availability of time series	
dat <- sdmx_ilostat(dsd = "STI_CHL_EMP_TEMP_SEX_AGE_NB/......?detail=serieskeysonly", 
                    sdmx_resource = 'data')
head(dat)

# as from 2009
sdmx_ilostat("STI_ZAF_EMP_TEMP_SEX_AGE_NB/......?startPeriod=2009-01-01&detail=serieskeysonly",
                    sdmx_resource = 'data')

# as from 2009
dat <- sdmx_ilostat("STI_FRA_UNE_TUNE_SEX_AGE_NB/STI.FRA.M.48..", 
                    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

# with multi country
sdmx_ilostat("STI_FRA_UNE_TUNE_SEX_AGE_NB/STI.FRA.M.48..", 
                     sdmx_resource = 'data', count = TRUE)


## End(Not run)

dbescond/Rilostat documentation built on May 15, 2019, 1:21 a.m.