Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing prefixes and short vignette on release branches #108

Merged
merged 22 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 36 additions & 34 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,48 @@

export("%>%")
export(auto_aux_update)
export(aux_censoring)
export(aux_countries)
export(aux_country_list)
export(aux_cp)
export(aux_cpi)
export(aux_data)
export(aux_dictionary)
export(aux_gdm)
export(aux_gdp)
export(aux_gdp_weo)
export(aux_income_groups)
export(aux_indicators)
export(aux_maddison)
export(aux_metadata)
export(aux_metadata_update)
export(aux_metaregion)
export(aux_missing_data)
export(aux_nan)
export(aux_npl)
export(aux_pce)
export(aux_pfw)
export(aux_pfw_key)
export(aux_pl)
export(aux_pl_clean)
export(aux_pop)
export(aux_ppp)
export(aux_prices)
export(aux_regions)
export(aux_sna)
export(aux_update_all)
export(aux_wdi)
export(aux_wdi_update)
export(aux_weo)
export(aux_weo_clean)
export(cl_validate_raw)
export(clean_validation_report)
export(convert_df_to_base64)
export(countries_validate_output)
export(cpi_validate_output)
export(cpi_validate_raw)
export(convert_df_to_base64)
export(draw_model)
export(fake_aux_sna)
export(gdm_validate_output)
export(gdm_validate_raw)
export(gdp_validate_output)
Expand All @@ -25,45 +59,13 @@ export(npl_validate_raw)
export(pce_validate_output)
export(pfw_validate_output)
export(pfw_validate_raw)
export(pip_censoring)
export(pip_countries)
export(pip_country_list)
export(pip_cp)
export(pip_cpi)
export(pip_dictionary)
export(pip_gdm)
export(pip_gdp)
export(pip_gdp_weo)
export(pip_income_groups)
export(pip_indicators)
export(pip_maddison)
export(pip_metadata)
export(pip_metadata_update)
export(pip_metaregion)
export(pip_missing_data)
export(pip_nan)
export(pip_npl)
export(pip_pce)
export(pip_pfw)
export(pip_pfw_key)
export(pip_pl)
export(pip_pl_clean)
export(pip_pop)
export(pip_ppp)
export(pip_prices)
export(pip_regions)
export(pip_sna)
export(pip_update_all_aux)
export(pip_wdi)
export(pip_wdi_update)
export(pip_weo)
export(pip_weo_clean)
export(pl_validate_output)
export(pop_validate_output)
export(pop_validate_raw)
export(popmain_validate_raw)
export(ppp_validate_output)
export(ppp_validate_raw)
export(save_aux_to_gh)
export(send_report)
export(sna_fy_validate_raw)
export(sna_validate_raw)
Expand Down
2 changes: 1 addition & 1 deletion R/auto_aux_update.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @param measure character: measure to be updated, if NULL will update all of
#' them
#' @inheritParams pip_pop_update
#' @inheritParams aux_pop_update
#' @export
auto_aux_update <- function(measure = NULL,
force = FALSE,
Expand Down
4 changes: 2 additions & 2 deletions R/pip_censoring.R → R/aux_censoring.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#' Load or update censoring data
#'
#'
#' @inheritParams pip_pfw
#' @inheritParams aux_pfw
#' @inheritParams pipfun::load_from_gh
#' @export
pip_censoring <- function(action = c("update", "load"),
aux_censoring <- function(action = c("update", "load"),
force = FALSE,
owner = getOption("pipfun.ghowner"),
maindir = gls$PIP_DATA_DIR,
Expand Down
4 changes: 2 additions & 2 deletions R/pip_countries.R → R/aux_countries.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#'
#' Update or load a dataset with countries.
#'
#' @inheritParams pip_cpi
#' @inheritParams aux_cpi
#' @inheritParams pipfun::load_from_gh
#' @export
pip_countries <- function(action = c("update", "load"),
aux_countries <- function(action = c("update", "load"),
force = FALSE,
owner = getOption("pipfun.ghowner"),
maindir = gls$PIP_DATA_DIR,
Expand Down
6 changes: 3 additions & 3 deletions R/pip_country_list.R → R/aux_country_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#' The dependency on the PCN Masterfile should be changed in the future.
#'
#' @param detail has an option TRUE/FALSE, default value is FALSE
#' @inheritParams pip_pfw
#' @inheritParams aux_pfw
#' @inheritParams pipfun::load_from_gh
#' @export
#' @return logical if `action = "update"` or data.table if `action = "load"`
pip_country_list <- function(action = c("update", "load"),
aux_country_list <- function(action = c("update", "load"),
maindir = gls$PIP_DATA_DIR,
force = FALSE,
branch = c("DEV", "PROD", "main"),
Expand All @@ -27,7 +27,7 @@ pip_country_list <- function(action = c("update", "load"),
if (action == "update") {

## Special national accounts --------
cl <- pip_country_list_update(class_branch = class_branch)
cl <- aux_country_list_update(class_branch = class_branch)

# validate country list raw data
cl_validate_raw(cl, detail = detail)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @param class_branch character: names of branch of GPID-WB/class repo. Default
#' if master
pip_country_list_update <-
aux_country_list_update <-
function(class_branch = "master") {

# Check arguments
Expand Down
6 changes: 3 additions & 3 deletions R/pip_cp.R → R/aux_cp.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#'
#' Update a list with country profiles data
#'
#' @inheritParams pip_cpi
#' @inheritParams aux_cpi
#' @inheritParams pipfun::load_from_gh
#' @export
pip_cp <- function(action = c("update", "load"),
aux_cp <- function(action = c("update", "load"),
force = FALSE,
owner = getOption("pipfun.ghowner"),
maindir = gls$PIP_DATA_DIR,
Expand All @@ -16,7 +16,7 @@ pip_cp <- function(action = c("update", "load"),
action <- match.arg(action)

if (action == "update") {
pip_cp_update(maindir = maindir,
aux_cp_update(maindir = maindir,
force = force,
owner = owner,
branch = branch,
Expand Down
2 changes: 1 addition & 1 deletion R/pip_cp_clean.R → R/aux_cp_clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @param file_names character: vector with names of files
#'
#' @return data.table
pip_cp_clean <- function(x,
aux_cp_clean <- function(x,
file_names) {

# ____________________________________________________________________
Expand Down
6 changes: 3 additions & 3 deletions R/pip_cp_update.R → R/aux_cp_update.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#'
#' Update a list with country profiles data
#'
#' @inheritParams pip_cp
#' @inheritParams aux_cp
#' @keywords internal
pip_cp_update <- function(maindir = gls$PIP_DATA_DIR,
aux_cp_update <- function(maindir = gls$PIP_DATA_DIR,
force = FALSE,
owner = getOption("pipfun.ghowner"),
branch = c("DEV", "PROD", "main"),
Expand Down Expand Up @@ -38,7 +38,7 @@ pip_cp_update <- function(maindir = gls$PIP_DATA_DIR,
})


dl <- pip_cp_clean(raw_files,
dl <- aux_cp_clean(raw_files,
file_names)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## download files --------
Expand Down
4 changes: 2 additions & 2 deletions R/pip_cpi.R → R/aux_cpi.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#'
#' @export
#' @import data.table
pip_cpi <- function(action = c("update", "load"),
aux_cpi <- function(action = c("update", "load"),
maindir = gls$PIP_DATA_DIR,
force = FALSE,
owner = getOption("pipfun.ghowner"),
Expand Down Expand Up @@ -46,7 +46,7 @@ pip_cpi <- function(action = c("update", "load"),
# ____________________________________________________________________________
# Computations ####
if (action == "update") {
pip_cpi_update(maindir = maindir,
aux_cpi_update(maindir = maindir,
force = force,
owner = owner,
branch = branch,
Expand Down
6 changes: 3 additions & 3 deletions R/pip_cpi_clean.R → R/aux_cpi_clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#'
#' Clean CPI data from Datalibweb to meet PIP protocols.
#'
#' @param y dataset with CPI data from `pip_cpi_update()`.
#' @param y dataset with CPI data from `aux_cpi_update()`.
#' @param cpivar character: CPI variable to be used as default. Currently it is
#' "cpi2011".
#' @inheritParams pip_cpi_update
#' @inheritParams aux_cpi_update
#'
#' @keywords internal
pip_cpi_clean <- function(y,
aux_cpi_clean <- function(y,
cpivar = getOption("pipaux.cpivar"),
maindir = gls$PIP_DATA_DIR,
branch = c("DEV", "PROD", "main")) {
Expand Down
6 changes: 3 additions & 3 deletions R/pip_cpi_update.R → R/aux_cpi_update.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Update CPI
#'
#' @inheritParams pip_cpi
#' @inheritParams aux_cpi
#' @keywords internal
pip_cpi_update <- function(maindir = gls$PIP_DATA_DIR,
aux_cpi_update <- function(maindir = gls$PIP_DATA_DIR,
force = FALSE,
owner = getOption("pipfun.ghowner"),
branch = c("DEV", "PROD", "main"),
Expand Down Expand Up @@ -34,7 +34,7 @@ pip_cpi_update <- function(maindir = gls$PIP_DATA_DIR,
# Cleaning ####

# Clean data
cpi <- pip_cpi_clean(cpi,
cpi <- aux_cpi_clean(cpi,
maindir = maindir,
branch = branch)

Expand Down
4 changes: 2 additions & 2 deletions R/pip_cpi_vintage.R → R/aux_cpi_vintage.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#'
#' @param msrdir character: measure directory.
#' @param dlwdir character: Datalibweb directory
#' @param force logical: If TRUE force update of veintage level 1.
#' @param force logical: If TRUE force update of vintage level 1.
#'
#' @keywords internal
pip_cpi_vintage <- function(msrdir = fs::path(gls$PIP_DATA_DIR, "_aux/", measure),
aux_cpi_vintage <- function(msrdir = fs::path(gls$PIP_DATA_DIR, "_aux/", measure),
dlwdir = Sys.getenv("PIP_DLW_ROOT_DIR"),
force = FALSE) {
time <- format(Sys.time(), "%Y%m%d%H%M%S") # find a way to account for time zones
Expand Down
1 change: 0 additions & 1 deletion R/aux_data_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#' @return data.table with key values
#' @export
#'
#' @examples
aux_data <- function(aux_file){

# list of possible auxiliary keys --------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions R/pip_dictionary.R → R/aux_dictionary.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#'
#' Update or load a dataset with the indicators master sheet.
#'
#' @inheritParams pip_pfw
#' @inheritParams aux_pfw
#' @inheritParams pipfun::load_from_gh
#' @export
pip_dictionary <- function(action = c("update", "load"),
aux_dictionary <- function(action = c("update", "load"),
force = FALSE,
owner = getOption("pipfun.ghowner"),
maindir = gls$PIP_DATA_DIR,
Expand Down
6 changes: 3 additions & 3 deletions R/pip_gdm.R → R/aux_gdm.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#'
#' The dependency on the PCN Masterfile should be changed in the future.
#'
#' @inheritParams pip_cpi
#' @inheritParams aux_cpi
#' @param detail has an option TRUE/FALSE, default value is FALSE
#' @inheritParams pipfun::load_from_gh
#' @export
pip_gdm <- function(action = c("update", "load"),
aux_gdm <- function(action = c("update", "load"),
force = FALSE,
owner = getOption("pipfun.ghowner"),
maindir = gls$PIP_DATA_DIR,
Expand All @@ -27,7 +27,7 @@ pip_gdm <- function(action = c("update", "load"),

if (action == "update") {

pip_gdm_update(force = force,
aux_gdm_update(force = force,
maindir = maindir,
owner = owner,
branch = branch,
Expand Down
6 changes: 3 additions & 3 deletions R/pip_gdm_update.R → R/aux_gdm_update.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#'
#' Update GDM data using the PovcalNet Masterfile.
#'
#' @inheritParams pip_gdm
#' @inheritParams aux_gdm
#' @keywords internal
pip_gdm_update <- function(force = FALSE,
aux_gdm_update <- function(force = FALSE,
owner = getOption("pipfun.ghowner"),
maindir = gls$PIP_DATA_DIR,
branch = c("DEV", "PROD", "main"),
Expand Down Expand Up @@ -193,7 +193,7 @@ pip_gdm_update <- function(force = FALSE,
## ............................................................................
## Remove any non-WDI countries ####

pip_country_list(maindir = maindir,
aux_country_list(maindir = maindir,
force = force,
branch = branch)

Expand Down
6 changes: 3 additions & 3 deletions R/pip_gdp.R → R/aux_gdp.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#' Update or load GDP data.
#'
#' @param detail has an option TRUE/FALSE, default value is FALSE
#' @inheritParams pip_pfw
#' @inheritParams aux_pfw
#' @inheritParams pipfun::load_from_gh
#' @param from character: Either "gh", "file" or "api". Default is "gh". "file"
#' and "gh" are synonymous
#' @export
pip_gdp <- function(action = c("update", "load"),
aux_gdp <- function(action = c("update", "load"),
force = FALSE,
maindir = gls$PIP_DATA_DIR,
owner = getOption("pipfun.ghowner"),
Expand All @@ -23,7 +23,7 @@ pip_gdp <- function(action = c("update", "load"),


if (action == "update") {
pip_gdp_update(maindir = maindir,
aux_gdp_update(maindir = maindir,
force = force,
owner = owner,
branch = branch,
Expand Down
4 changes: 2 additions & 2 deletions R/pip_gdp_update.R → R/aux_gdp_update.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#'
#' Update GDP data using WDI, Maddison and Special cases.
#'
#' @inheritParams pip_gdp
#' @inheritParams aux_gdp
#' @inheritParams pipfun::load_from_gh
#' @keywords internal
pip_gdp_update <- function(maindir = gls$PIP_DATA_DIR,
aux_gdp_update <- function(maindir = gls$PIP_DATA_DIR,
force = FALSE,
owner = getOption("pipfun.ghowner"),
branch = c("DEV", "PROD", "main"),
Expand Down
Loading