PaulC91 / NCoVUtils

Utility functions for the 2019-NCoV outbreak

Home Page:https://epiforecasts.io/NCoVUtils/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Utility functions for the Covid-19 outbreak

badge Build Status Codecov test coverage develVersion Documentation DOI

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:

NCoVUtils::get_international_linelist()

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:

NCoVUtils::get_italy_regional_cases()

Extract regional case counts from France:

NCoVUtils::get_france_regional_cases()

Extract regional case counts from Germany:

NCoVUtils::get_germany_regional_cases()

Extract regional case counts from the United States of America:

NCoVUtils::get_us_regional_cases()

Extract regional case counts by NHS region from England and Scotland, as well as country-level from Wales and Northern Ireland:

NCoVUtils::get_uk_nhs_region_cases()

Extract dataset of government intervention measures compiled by ACAPS:

NCoVUtils::get_interventions_data()

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:

Rscript inst/scripts/render_output.R

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):

docker build . -t ncovutils

To run the docker image run:

docker run -d -p 8787:8787 --name ncovutils -e USER=ncovutils -e PASSWORD=ncovutils ncovutils

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).

--mount type=bind,source=$(pwd)/tmp,target=/home/ncovutils

To access the command line run the following:

docker exec -ti ncovutils bash

Alternatively the package environment can be accessed via binder.

About

Utility functions for the 2019-NCoV outbreak

https://epiforecasts.io/NCoVUtils/

License:Other


Languages

Language:R 98.9%Language:Dockerfile 1.1%