The goal of {epichecks} is to provide functions for simplifying data quality checks and threshold analyses for IDSR data. The package further contains helper functions that automate the production of feedback documents for countries.
Currently the package is not on CRAN. Once it is - you can install the released version of epichecks from CRAN with:
# install.packages("epichecks")
In order to install the package you will first need to install an extra
bit of software called
Rtools.
You can download the installer from:
https://cran.r-project.org/bin/windows/Rtools/
Please install the version highlighted in green.
Once this is installed and you have restarted your computer, the development version of the package can be installed from GitHub with:
install.packages("remotes")
remotes::install_github("R4IDSR/epichecks")
If you do not have a LaTeX editor installed on your computer, then please run the following code to install TinyTex. This is needed in order to be able to create Word and PDF documents using R markdown.
install.packages('tinytex')
tinytex::install_tinytex()
# to uninstall TinyTeX, run tinytex::uninstall_tinytex()
The package is set up to run from to the WHO AFRO sharepoint IDSR folder.
Within the main IDSR folder create an R project
(e.g. WHO_AFRO.Rproj) - remember to open R through this project
every time - to have the correct root directory.
Within the IDSR folder have a Data Files folder.
The Data Files folder contains the PHE dataset, the Outbreak
reporting dataset and a folder for each Year which in turn has a
folder for each calendar week.
Each calendar week has IDSR data for each country with an
!Imported folder, as XLSX files.
Within the Data Files folder create an Output folder, and within
that a folder for each Year. The package will create a folder for
each calendar week and place, for each country, an excel with flags and
a pdf letter.
As an example:
This section explains how to make weekly feedback for countries based on pre-processed IDSR data.
Open your R project (e.g. WHO_AFRO.Rproj) and type the below code.
This will produce outputs for week 1 of 2020 as an example. See ?week_report for details of parameters that can be adjusted. n.b. this can take a couple of minutes to run
library(epichecks)
week_report(current_year = 2020, current_week = 1)
This function creates an excel (Country_2020_W01.xlsx) with two
tabs, the first flags missing disease counts data and the second flags
when disease counts data exceeds pre-defined thresholds.
It also creates a pdf letter (Country_2020_W01.pdf) which
summarises the flags in the excel.
These two files are created for each country.
In addition it creates two files for internal WHO use.
The first is a summary of countries reporting, with counts of diseases,
missings, and threshold flags (SummaryReport_2020_W01.xlsx).
The second is an R dataset with all the countries for that week
combined. (Merged.Rds)
Three dictionaries are included in the {epichecks} package, and used
internally for processing.
These include country names, disease names and threshold alert
definitions.
This section explains how to use an R markdown template to create monthly WHO AFRO bulletins which includes information from IDSR data, PHE data and **Outbreak monitoring data*.
To understand the basics of opening and using templates see this short walkthrough from the R4Epis project.
Once {epichecks} is installed you should be able to see the WHO AFRO monthly bulletin template as below. Save your RMD file in the root directory (i.e. the same place where your **WHO_AFRO.Rproj is saved).
You then need to make sure that file paths are correct for the datasets, and update the calendar week sections of the code, see below. This can then be changed each month to produce the appropriate report.
You can then knit to create a word document in the same folder where the Rmd file is saved.
Please note that the ‘epichecks’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.