Skip to contents

Load cache data

Usage

pip_load_cache(
  country = NULL,
  year = NULL,
  tool = c("PC", "TB"),
  survey_acronym = NULL,
  data_level = NULL,
  welfare_type = NULL,
  source = NULL,
  cache_id = NULL,
  condition = NULL,
  type = c("dataframe", "list"),
  root_dir = Sys.getenv("PIP_ROOT_DIR"),
  pipedir = pip_create_globals(root_dir)$PIP_PIPE_DIR,
  verbose = getOption("pipload.verbose")
)

Arguments

country

character: vector of ISO3 country codes.

year

numeric: survey year

tool

character: PIP tool in which data will be used. It could be PC for Poverty Calculator or TB for Table Maker. Others will be added

survey_acronym

character: Survey acronym

data_level

character: either "D1" for national, "D2" for urban/rural, "D3" for subnational

welfare_type

character: Either "CON" for consumption or "INC" for income

source

character: Source of data. It could be GPWG, HIST, GROUP, synth, BIN, and ALL. The latter is used only in Table Maker.

cache_id

character: If user knows the precise cache ID

condition

character: logical condition that applies to all surveys. For example, "year > 2012". Make sure the condition uses the names of the variables in pip_load_inventory(): orig, filename, country_code, year, survey_acronym, vermast, veralt, collection, module, tool, and source. Can't be used with arguments country, year, survey_acronym , vermast, veralt, module or tool.

type

character: Either dataframe or list. Defaults is dataframe.

root_dir

character: root directory of the PIP data

pipedir

charater: directory of pipeline. Default is pip_create_globals(root_dir)$PIP_PIPE_DIR

verbose

logical: If TRUE, display informative messages. Default TRUE

Value

data frame

Examples

if (FALSE) {
pip_load_cache("PRY", 2017)
}