2.3 Installing the infrastructure

The infrastructure can be installed locally by downloading the repository from github and installing dependencies. To run the full pipeline, the user will need an authentication token used to install the private (i.e. not publicly available) WHO package phifunc, which is used for collating data.

2.3.1 Downloading the repository

You can download the repository from the code tab on the github page as illustrated in the figure 2.2.

Downloading or cloning the repository. The repository containing the data infrastructure can be downloaded as a zip archive or cloned using github.

Figure 2.2: Downloading or cloning the repository. The repository containing the data infrastructure can be downloaded as a zip archive or cloned using github.

We recommend using SSH to clone the repository. For more information on setting up an SSH access to github, see this webpage.

Once you are set up to access github using SSH, you can clone the repository using GIT from the command line in your favourite terminal, by typing:

The advantage of cloning the repository rather than merely downloading a zip archive is that you will be able to update the infrastructure automatically using git pull.

By default, your local copy of the repository will be called trend_analysis_public. It is possible to change this name, but you will need to update the name of the factory in the factory_config file. From now on, we will refer to this folder as root folder.

2.3.2 Getting the phifunc authentication token

The tool we use to collate COVID-19 data is a package called phifunc developed at WHO. Because this package internally uses some non-public data API, it is currently not shared publicly, and an authentication token is needed to be able to install it in R. This token is a kind of password, stored in a file called phifunc_token in the root folder.

The easiest way to add this file is ask for it from someone in the COVID-19 analytics team, and add this file to the root of the project. Make sure you do not alter or rename it. Once phifunc_token is present in your infrastructure, the scripts installing dependencies will detect it automatically when run, and you will be able to run all analyses locally.

2.3.3 Installing dependencies

To install the dependencies, open the reportfactory by double-clicking on open.Rproj, or otherwise starting an R session in the root folder (trend_analysis_public by default), and copy-paste the following commands:

Note that the last operation will require the authentication token (file phifunc_token) for installing phifunc. We will be working separately on a similar infrastructure using data that are directly publicly available.