Summarize forecast hub data for a specific reference date.
Source:R/summarize_ref_date_forecasts.R
summarize_ref_date_forecasts.RdThis function generates a tibble of forecast data for a given reference date. It can filter by model IDs; allows flexibility retrieve all models or specific subsets (e.g., ensemble only).
Usage
summarize_ref_date_forecasts(
reference_date,
base_hub_path,
disease,
population_data,
horizons_to_include = c(0, 1, 2),
excluded_locations = NULL,
targets = NULL,
model_ids = NULL
)Arguments
- reference_date
character, the reference date for the forecast in YYYY-MM-DD format (ISO-8601).
- base_hub_path
character, path to the forecast hub directory.
- disease
character, disease name ("covid" or "rsv"). Used to derive hub name and file prefix.
- population_data
data frame with columns "location" and "population". Adds population-based calculations.
- horizons_to_include
integer vector, horizons to include in the output. Default: c(0, 1, 2).
- excluded_locations
character vector or named list specifying US state 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. Converted to hub codes internally. Default: NULL.
- targets
character vector, target name(s) to filter forecasts. If NULL (default), does not filter by target.
- model_ids
character vector of model IDs to include. If NULL (default), includes all models.