Skip to contents

deflate welfare to add_pip_vars (Higher level)

Usage

pd_add_pip_vars(lf, cpfw, cpi, ppp, pop)

Arguments

lf

list of dataframes with welfare variable called welfare

cpfw

data frame with Price framework data for country/survey in df. It is loaded with get_country_pfw(df, pfw). pfw is loaded in pipload::pip_load_aux("pfw")

cpi

dataframe from pipload::pip_load_aux("cpi")

ppp

dataframe from pipload::pip_load_aux("ppp")

pop

dataframe from pipload::pip_load_aux("pop")

Value

data.table with new variable add_pip_vars

Examples

ppp  <- pipload::pip_load_aux("ppp")
#> ! root_dir is not defined. Directory paths will lack network-drive root
#> directory
#> Error: [ENOENT] Failed to search directory '/pip_ingestion_pipeline/pc_data/cache/clean_survey_data': no such file or directory
cpi  <- pipload::pip_load_aux("cpi")
#> ! root_dir is not defined. Directory paths will lack network-drive root
#> directory
#> Error: [ENOENT] Failed to search directory '/pip_ingestion_pipeline/pc_data/cache/clean_survey_data': no such file or directory
pop  <- pipload::pip_load_aux("pop")
#> ! root_dir is not defined. Directory paths will lack network-drive root
#> directory
#> Error: [ENOENT] Failed to search directory '/pip_ingestion_pipeline/pc_data/cache/clean_survey_data': no such file or directory
md   <- pipload::pip_load_dlw(country = "PRY", 2012)
#> ! root_dir is not defined. Directory paths will lack network-drive root
#> directory
#> Error: [ENOENT] Failed to search directory '/pip_ingestion_pipeline/pc_data/cache/clean_survey_data': no such file or directory
pfw  <- pipload::pip_load_aux("pfw")
#> ! root_dir is not defined. Directory paths will lack network-drive root
#> directory
#> Error: [ENOENT] Failed to search directory '/pip_ingestion_pipeline/pc_data/cache/clean_survey_data': no such file or directory
cpfw <- get_country_pfw(md, pfw)
#> Error in uniqueN(pfw, by = keyVar): object 'pfw' not found
md   <- pd_split_alt_welfare(md, cpfw)
#> Error in pd_split_alt_welfare(md, cpfw): object 'cpfw' not found
x    <- pd_dlw_clean(md, cpfw)
y    <- pd_wbpip_clean(lf = x, cpfw = cpfw)

pd_add_pip_vars(lf = y, cpfw = cpfw, cpi = cpi, ppp = ppp, pop = pop)
#> Error: Error in get(fnms[[i]]): object 'cpfw' not found
#> 


gd   <- pipload::pip_load_dlw("CHN", 2015)
#> ! root_dir is not defined. Directory paths will lack network-drive root
#> directory
#> Error: [ENOENT] Failed to search directory '/pip_ingestion_pipeline/pc_data/cache/clean_survey_data': no such file or directory
cpfw <- get_country_pfw(gd, pfw)
#> Error in uniqueN(pfw, by = keyVar): object 'pfw' not found
gd   <- pd_split_alt_welfare(gd, cpfw)
#> Error in pd_split_alt_welfare(gd, cpfw): object 'cpfw' not found
x    <- pd_dlw_clean(gd, cpfw)
y    <- pd_wbpip_clean(lf = x, cpfw = cpfw)

pd_add_pip_vars(lf = y, cpfw = cpfw, cpi = cpi, ppp = ppp, pop = pop)
#> Error: Error in get(fnms[[i]]): object 'cpfw' not found
#> 

gd   <- pipload::pip_load_dlw("ARE", 2019)
#> ! root_dir is not defined. Directory paths will lack network-drive root
#> directory
#> Error: [ENOENT] Failed to search directory '/pip_ingestion_pipeline/pc_data/cache/clean_survey_data': no such file or directory
cpfw <- get_country_pfw(gd, pfw)
#> Error in uniqueN(pfw, by = keyVar): object 'pfw' not found
gd   <- pd_split_alt_welfare(gd, cpfw)
#> Error in pd_split_alt_welfare(gd, cpfw): object 'cpfw' not found
x    <- pd_dlw_clean(gd, cpfw)
y    <- pd_wbpip_clean(lf = x, cpfw = cpfw)

pd_add_pip_vars(lf = y, cpfw = cpfw, cpi = cpi, ppp = ppp, pop = pop)
#> Error: Error in get(fnms[[i]]): object 'cpfw' not found
#>