distribution_ilostat: Switch ilostat to distribution

View source: R/distribution_ilostat.r

distribution_ilostatR Documentation

Switch ilostat to distribution

Description

Get distribution for ilostat number of persons only.

Usage

distribution_ilostat(x, var)

Arguments

x

dataset to transform into distribution.

var

String variable name use for the distribution default "no", could be "sex", "classif1", "classif2".

Details

this function use the max of the corresponding grouping so it is important to not filter any subset of the corresponding variable selected for the distribution at this level, ie. if you remove SEX_T, the distribution by sex will only have SEX_F or SEX_M / max(SEX_M, SEX_F) * 100, which is no longer a distribution.

In addition, distribution is only applicable for indicators with Number of persons (usually in thousands), So plse do not distribute ratios, earnings, hours of works, CPI, GDP etc ... no warning will prevent for that if doubts use distribution from get_ilostat() instead of, warnings will help you.

Value

a data_frame. obs_status will no longer be a number of persons but a percentage.

Author(s)

David Bescond bescond@ilo.org

References

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

Examples

## Not run: 
 dat <- get_ilostat("EMP_TEMP_SEX_STE_GEO_NB_A", cache = FALSE)
 dat_dist <- distribution_ilostat(dat, "classif1")
 head(dat_dist)
 clean_ilostat_cache() 

## End(Not run)

dbescond/Rilostat documentation built on Feb. 21, 2024, 9:31 p.m.