get.CME.UI.data: Return different format of the final aggregate results...

View source: R/funcs_read_data.R

get.CME.UI.dataR Documentation

Return different format of the final aggregate results country summary

Description

'get.CME.UI.data' can read in "Rates & Deaths_Country Summary.csv" for any indicators published so far and include Sex, Quantile in the output. If there is only median (i.e. no Quantile column in the dataset) the function will check if there is only one row per country. An example list of summary.csv files directories could be obtained by load.final_dir. Choose the 'format' of the output dataset from 'long', 'wide_q'(wide quantile), 'wide_year', 'wide_ind' (wide indicator) and 'wide_get' (one column for rate and one column for death)

Usage

get.CME.UI.data(
  dir_file = NULL,
  c_iso = NULL,
  year_range = NULL,
  get = "both",
  idvars = c("OfficialName", "ISO3Code"),
  sex = NULL,
  format = "long",
  round_digit = NULL,
  quantile = TRUE
)

Arguments

dir_file

directory to the dataset to be read: directory to aggregate final

c_iso

country ISO3Code, default to NULL: returns all countries in the dataset

year_range

a vector of years, default to NULL: use all available years

get

default to "rate". Choose among "rate", "death", or "both"

idvars

default to "'OfficialName', 'ISO3Code'", what id vars you want to include

sex

default as NULL, will determine sex from directory of 'dir_file' unless supplied

format

Choose format among raw, long, wide_year, wide_ind, and wide_get, default to "long". All the wide-format just 'dcasts' the long-format data, wide_get means two columns: rate and death

round_digit

digits to round estimates, default to 'NULL'

quantile

default to TRUE: return upper, median, lower; FALSE: only median.

Value

a data.table (data.frame)


unicef-drp/CME.assistant documentation built on Oct. 15, 2023, 7:08 p.m.