Skip to contents

This function updates all or a selected subset of auxiliary data measures, ensuring that both the corresponding GitHub repositories and the network drive (Y drive) are synchronized.

Usage

update_all_aux(
  measures = NULL,
  verbose = FALSE,
  log = TRUE,
  log_save = FALSE,
  ...
)

Arguments

measures

A character vector of auxiliary data measures to update. If NULL, all known measures will be updated.

verbose

Logical; whether to print informative messages to the console.

log

Logical; whether to log the update process.

log_save

Logical; whether to save the log file to disk.

...

Arguments passed on to aux_fun

repo

character: Name of the GitHub repository containing the auxiliary data Defaults to "aux_<measure>" unless measure is "income_groups" or "country_list", in which case it defaults to "Class".

owner

character: GitHub repository owner. Default is getOption("pipfun.ghowner")

maindir

character: Main directory of the project. Default is getOption("pipaux.working_dir")

processed

environment: Environment that keeps track of already processed measures to avoid redundant processing. Default is a new empty environment

force

logical: If TRUE, forces an update even if the data appears up to date. Default is FALSE

tag

character: Specifies the GitHub branch tag for versioning. Defaults to release_branch, which is determined from the working release

Value

A list containing the update status for each measure. Each element is a list with the components: measure (character), success (logical), and error (character or NULL).

Details

When measures = NULL, all known auxiliary data measures (i.e., all GitHub repos starting with "aux_") are processed. Otherwise, provide a character vector of specific measures to process selectively.

The function logs the update status, captures any errors, and optionally saves the log to a file. This is useful for tracking the status of each update and debugging if needed.

See also

aux_fun() for the function that performs the update of a single measure.

Examples

if (FALSE) { # \dontrun{
# Update all measures and save the log
update_all_aux(log = TRUE, log_save = TRUE)

# Update only specific measures
update_all_aux(measures = c("cpi", "gdp"), verbose = TRUE)
} # }