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.
Install the package and all dependencies with:
remotes::install_github("epiforecasts/NCoVUtils", dependencies = TRUE)
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()
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 the documentation with the following:
Rscript inst/scripts/render_output.R
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.