label_ilostat: Switch Ilostat codes and labels

Description Usage Arguments Details Value Author(s) References Examples

View source: R/label_ilostat.R

Description

Gets definitions/labels for ilostat codes from ilostat dictionaries.

Usage

1
2
3
4
5
6
label_ilostat(
  x,
  dic = NULL,
  code = NULL,
  lang = getOption("ilostat_lang", "en")
)

Arguments

x

A character or a factor vector or a data_frame to labelled.

dic

A string (vector) naming ilostat dictionary or dictionaries. If NULL (default) dictionary names are taken from column names of the data_frame. A character or a factor vector or a data_frame to labelled,

code

a vector of names of the column for which code columns should be retained. Set to "all", keep all the code.

lang

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

Details

A character or a factor vector of codes returns a corresponding vector of definitions. label_ilostat labels also data_frames from get_ilostat. For vectors a dictionary "time" and "values" columns are returned as they were, so you can supply data_frame from get_ilostat and get data_frame with definitions instead of codes.

Value

a vector or a data_frame. The suffix ".label" is added to code column names.

Author(s)

David Bescond bescond@ilo.org

References

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

Examples

1
2
3
4
5
6
7
## Not run: 
 dat <- get_ilostat("UNE_2UNE_SEX_AGE_NB_A", cache = FALSE)
 dat_lab <- label_ilostat(dat)
 head(dat_lab)
 clean_ilostat_cache() 

## End(Not run)

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