run_report.Rd
If executed as a standalone function, all filtering must be performed beforehand. This function is also invoked within the app.
run_report(
data = SignalDetectionTool::input_example,
report_format = "HTML",
method = "FarringtonFlexible",
number_of_weeks = 6,
strata = c("county", "age_group"),
interactive = TRUE,
tables = TRUE,
output_file = NULL,
output_dir = ".",
signals_padded = NULL,
signals_agg = NULL,
intervention_date = NULL
)
data.frame containing surveillance data in linelist format following the format specified in `input_metadata`
character, format of the report: "HTML" or "DOCX"
a character string, signal detection method to be used. One of "FarringtonFlexible", "EARS" , "CUSUM", "Mean", "Timetrend", "Harmonic", "Harmonic with timetrend", "Step harmonic", "Step harmonic with timetrend". You can retrieve the full list using [names(available_algorithms())].
integer, number of weeks for which signals are generated
A character vector specifying the columns to stratify. If `NULL` no strata are used. the analysis. Default is NULL.
Logical, indicating whether interactive elements should be included in the report. Only applicable when `report_format = "HTML"`. Defaults to `TRUE`.
Logical. True if tables should be included in report.
A character string specifying the name of the output file (without directory path). If `NULL` (default), the file name is automatically generated to be SignalDetectionReport. See render for more details.
A character string specifying the output directory for the rendered output file (default is ".", which means the rendered file will be saved in the current working directory. See render for more details. `NULL` is used when running the report from shiny app which will take the Downloads folder as default option for saving.
calculated and padded signals (for use within the app, default is NULL)
aggregated signals (for use within the app, default is NULL)
A date object or character of format yyyy-mm-dd or NULL specifying the date for the intervention. This can be used for interrupted timeseries analysis. It only works with the following methods: "Mean", "Timetrend", "Harmonic", "Harmonic with timetrend", "Step harmonic", "Step harmonic with timetrend". Default is NULL which indicates that no intervention is done.
the compiled document is written into the output file, and the path of the output file is returned; see render
[names(available_algorithms())]
if (FALSE) {
# Example 1: Run report with specified parameters and HTML format output
run_report(
report_format = "HTML",
data = SignalDetectionTool::input_example,
method = "FarringtonFlexible",
strata = c("county", "sex"),
interactive = TRUE,
tables = TRUE,
number_of_weeks = 6
)
# Example 2: An example output directory specified
run_report(
method = "EARS",
output_dir = "C:/Users/SmithJ/Documents"
)
# Example 3: An example output file name is speficied
run_report(
method = "EARS",
output_file = "My Signal Report"
)
# Example 4: No strata are used
run_report(
report_format = "HTML",
data = SignalDetectionTool::input_example,
method = "EARS",
strata = NULL
)
}