Learn R Programming

EpiSignalDetection (version 0.1.2)

runEpiSDReport: Run the EpiSignalDetection report (HTML markdown)

Description

Function to render the markdown report of alarms in HTML format for ECDC Signal Detection Report

Usage

runEpiSDReport(input, stratified, outputfile, run_pandoc = TRUE)

Value

An HTML report. When run_pandoc = TRUE, the compiled document is written into the output file, and the path of the output file is returned. When

run_pandoc = FALSE, the path of the Markdown output file, with attributes knit_meta (the knitr meta data collected from code chunks) and intermediates (the intermediate files/directories generated by render())

Arguments

input

list of parameters as defined in the Signal Detection Application (see runEpiSDApp)

(i.e. list(disease, country, indicator, stratification, unit, daterange, algo, testingperiod))

(see also default parameters in system.file("SignalDetectionReport_HTML", "SignalDetectionReport.Rmd", package = "EpiSignalDetection"))

stratified

a logical value indicating whether the report should be stratified by Population variable or not (default FALSE)

outputfile

output file name (e.g. 'C:/R/report.html')

(default value is a temporary folder - file.path(tempdir(), "SignalDectectionReport.html"))

run_pandoc

An option for whether to run pandoc to convert Markdown output.

Details

Datasets to use in the report:

  • Default dataset included in the package (Salmonellosis 2007-2016 or Measles 1999-2018 data) (i.e. input$file = NULL);

  • External dataset:

    • --> An export (csv format) from the ECDC Surveillance Atlas of Infectious Diseases: http://atlas.ecdc.europa.eu/public/index.aspx.

      On the ECDC "Surveillance Atlas of Infectious Diseases" web site:

      • 1- Choose the disease/health topic to analyse

      • 2- Export the data (csv) using the default settings

      • 3- Specify the location of this external dataset in the input argument of the runEpiSDReport() function (e.g. input <- list(file = list(datapath = "C:/Users/Downloads/ECDC_surveillance_data_Pertussis.csv"), disease = "Pertussis", country = "Greece", indicator = "Reported cases", stratification = "All cases", unit = "Month", daterange = c("2011-12-01", "2016-12-01"), algo = "FarringtonFlexible", testingperiod = 3))

      • 4- You can now render the re markdown report... (e.g. runEpiSDReport(input = input))

    • --> Any dataset specified as described in the package vignette.

See Also

Default dataset used in the report SignalData

Signal Detection Application runEpiSDApp

Examples

Run this code
if (FALSE) {
#-- Running the report as a standalone function
runEpiSDReport()    #Definition of each input parameter
                     #is done one by one through the R console

#---> OR

#-- First setting the parameters to run the report for
input <- list(
disease = "Salmonellosis",
country = "Portugal",
indicator = "Reported cases",
stratification = "Confirmed cases",
unit = "Month",
daterange = c("2011-01-01", "2016-12-31"),
algo = "FarringtonFlexible",
testingperiod = 6
)

#-- Second running the report based on the EpiSignalDetection::SignalData dataset
#-- and store it in a temporary folder
runEpiSDReport(input = input)

#-- Running the report based on the EpiSignalDetection::SignalData dataset
#-- and store the HTML output 'test.html' in the folder 'C:/R/'
runEpiSDReport(input = input, outputfile = "C:/R/test.html")

#-- Running the report based on external data
input <- list(
file = list(datapath = "C:/Users/Downloads/ECDC_surveillance_data_Pertussis.csv"),
disease = "Pertussis",
country = "Greece",
indicator = "Reported cases",
stratification = "All cases",
unit = "Month",
daterange = c("2011-12-01", "2016-12-01"),
algo = "FarringtonFlexible",
testingperiod = 3
)

runEpiSDReport(input = input, stratified = TRUE)
}


Run the code above in your browser using DataLab