query codelist, data and metadata via ilo sdmx api
A datastructure definition, see examples
section,
: a character, type of info to be returned from the sdmx api: 'codelist'
(default),
'data'
, 'dataflow'
, 'conceptref'
,
: for data only, a character, format of info to be returned from the sdmx api: 'csv'
(default) others no longer available.
a character for language. Available are "en"
(default),
"fr"
and "es"
. Can be set also with options(ilostat_lang = 'fr'),
a logical, count data records only if resource = 'data'
, FALSE
(default),
a logical, if TRUE
, don't return message from processing, FALSE
(default).
Can be set also with options(ilostat_quiet = TRUE).
See citation("Rilostat")
ilostat sdmx user guidelines: https://webapps.ilo.org/ilostat-files/Documents/SDMX_User_Guide.pdf
if (FALSE) {
########## 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
# to get the order of the filter first get the conceptref of the DSD
filter_position <- sdmx_ilostat(dsd = 'EMP_TEMP_SEX_AGE_NB',
sdmx_resource = 'conceptref')
filter_position
# COUNTRY and FREQ are in first and second position of the filters
dat <- sdmx_ilostat(dsd = "EMP_TEMP_SEX_AGE_NB/FRA+DEU.Q...",
sdmx_resource = 'data')
head(dat)
### with attribute
dat <- sdmx_ilostat(dsd = 'EMP_TEMP_SEX_AGE_NB/ARG.Q...',
sdmx_resource = 'data')
head(dat)
# without attribute
dat <- sdmx_ilostat(dsd = "EMP_TEMP_SEX_AGE_NB/ARG.Q...?detail=dataonly",
sdmx_resource = 'data')
head(dat)
########## count data available
sdmx_ilostat("UNE_TUNE_SEX_AGE_NB/FRA.Q...",
sdmx_resource = 'data', count = TRUE)
}