Generate a full report for a disease and reference date with sensible, consistent configuration.
Source:R/generate_hub_report.R
generate_hub_report.RdWrapper function for write_ref_date_summary_ens(),
write_ref_date_summary_all(), write_viz_target_data(),
and write_webtext().
Usage
generate_hub_report(
reference_date,
disease,
hub_reports_path,
base_hub_path = NULL,
horizons = c(0, 1, 2),
population_data = hubhelpr::population_data,
excluded_locations = NULL,
targets = NULL,
n_models_for_ens_reporting = NULL,
output_format = "csv",
overwrite_existing = FALSE,
observed_data_use_hub = FALSE,
observed_data_as_of = "latest",
observed_data_start_date = NULL,
observed_data_end_date = NULL,
verbose = TRUE
)Arguments
- reference_date
character, the reference date for the forecast in YYYY-MM-DD format (ISO-8601).
- disease
character, disease name ("covid" or "rsv").
- hub_reports_path
character, path to forecast hub reports directory.
- base_hub_path
character, path to the forecast hub directory.
- horizons
integer vector, forecast horizons to include in the output. Default: c(0, 1, 2).
- population_data
data frame with columns "location" and "population". Used to compute per-population metrics such as rates per 100k from rate counts. Default: population_data.
- excluded_locations
NULL, character vector, or named list of US state/territory abbreviations to exclude. If a character vector, locations are excluded across all targets. If a named list, names should be target names (or "all" for global exclusions) mapping to character vectors of abbreviations. Default: NULL (no exclusions).
- targets
character vector, target name(s) to filter forecasts for reporting. If NULL (default), does not filter out targets.
- n_models_for_ens_reporting
integer, minimum number of designated model submissions required to include an ensemble forecast in the report. Default: NULL, which uses the minimum designated for
reference_date, so that regenerating an older report applies the rule it was published under rather than today's. Seeget_reference_date_ens_minimum().- output_format
character, output file format. One of "csv", "tsv", or "parquet". Default: "csv".
- overwrite_existing
logical. If TRUE, overwrite existing files. Default: FALSE.
- observed_data_use_hub
Logical, whether to read data from the hub's time-series file (TRUE) or pull fresh data from raw sources (FALSE) when creating observed data files. Default:
FALSE.- observed_data_as_of
As of date for the observed data shown in the report. Either an object coercible by
as.Date()or "latest" to use the most recent available vintage. Default "latest". Used only whenobserved_data_use_hub = TRUE.- observed_data_start_date
Date, earliest date to include in observed data shown in the report. Default: NULL (no filtering). Used only when
observed_data_use_hub = FALSE.- observed_data_end_date
Date, latest date to include in observed data shown in the report. Default: NULL (no filtering). Used only when
observed_data_use_hub = FALSE.- verbose
Report progress to the terminal? Default
TRUE.