Note: This package makes extensive use of memoise and writes a .cache to the directory in which its functions are run. This speeds up data retrieval and avoids hitting rate limits but does not follow CRAN best practice. Use with care. The cache can be reset with reset_cache() when updated data is required from the online source.

Installation

Install the package and all dependencies with:

remotes::install_github("epiforecasts/NCoVUtils", dependencies = TRUE)

Usage

See the individual function documentation for full details of present functionality. The main function imports and cleans the linelist.

NCoVUtils::get_linelist()

For individual region/city data outside of Hubei the following function has been provided:

Extract WHO case counts using:

NCoVUtils::get_who_cases()

Extract ECDC case and deaths counts using:

NCoVUtils::get_ecdc_cases()

Extract total cases (and deaths) by region using:

NCoVUtils::get_total_cases()

Extract regional case counts from Italy:

See the function reference for a full list of data sets that package can be used to extract.

Development

Set up

Set your working directory to the home directory of this project (or use the provided Rstudio project). Install the analysis and all dependencies with:

remotes::install_github("epiforecasts/NCoVUtils", dependencies = TRUE)

Render documentation

Render the documentation with the following:

Docker

This package is developed in a docker container based on the tidyverse docker image.

To build the docker image run (from the NCoVUtils directory):

To run the docker image run:

The rstudio client can be found on port :8787 at your local machines ip. The default username:password is ncovutils:ncovutils, set the user with -e USER=username, and the password with - e PASSWORD=newpasswordhere. The default is to save the analysis files into the user directory.

To mount a folder (from your current working directory - here assumed to be tmp) in the docker container to your local system use the following in the above docker run command (as given mounts the whole ncovutils directory to tmp).

{bash, eval = FALSE} --mount type=bind,source=$(pwd)/tmp,target=/home/ncovutils

To access the command line run the following:

{bash, eval = FALSE} docker exec -ti ncovutils bash

Alternatively the package environment can be accessed via binder.