2.4 Running the infrastructure locally

The data infrastructure can run in two modes:

  • remotely, through github actions; this happens at specific times but can also be triggered manually

  • locally, on your computer

Here, we outline the local use. You will find more information about the github actions in the automation chapter.

2.4.1 Updating all analyses

The simplest way to update all analyses is run the script run_factory.R (using source(run_factory.R), or step-by-step by opening the file in Rstudio). This will:

  • download, assemble and pre-process the most recent data
  • run a separate report for each WHO region, storing timestamped output in the outputs/ folder, as well as figures, notes, and rds files in the asmodee_outputs folder
  • update the README file with the new analyses

2.4.2 Updating the data

The report assemble_data.Rmd performs the data download, gathering and preparation. To update the data, run the following command within the factory:

2.4.3 Running analyses for a specific region

The report regional_analyses.Rmd performs all analyses for a given WHO region, including calculations of growth rates and trend change detection using ASMODEE. The report automatically uses the latest version of the clean data (so needs to be run after assemble_data.Rmd if the data need updating). The parameter who_region determines which WHO region is analysed. Possible values are: AFRO, EMRO, EURO (default), PAHO, SEARO, WPRO. To run the report, type:

where:

  • reg is the letter code for the WHO region to use (in upper case)
  • cores is the number of cores to be used for the ASMODEE analyses, which support parallelisation
  • subfolder indicates the name of the folder in outputs where the timestamped results will be stored

2.4.4 Generating the synthesis report

The report elr_synthesis collates the latest results for all WHO regions, classifies countries by level of risk, and produces a synthesis html report, alongside an .xlsx file dynamics_summary.xlsx summarising results and a list of excluded countries in the text file excluded_countries.txt.

To compile this report, use: