Skip to contents

This function calls summarize_ref_date_forecasts() and writes the resulting tibble to disk in the specified format.

Usage

write_ref_date_summary(
  reference_date,
  base_hub_path,
  hub_reports_path,
  disease,
  file_suffix,
  horizons_to_include = c(0, 1, 2),
  excluded_locations = character(0),
  output_format = "csv",
  targets = NULL,
  model_ids = NULL,
  population_data,
  column_selection = tidyselect::everything()
)

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.

hub_reports_path

character, path to forecast hub reports directory.

disease

character, disease name ("covid" or "rsv").

file_suffix

character, suffix to append to filename (e.g., "map_data", "forecasts_data").

horizons_to_include

integer vector, horizons to include in the output. Default: c(0, 1, 2).

excluded_locations

character vector of location codes to exclude from the output. Default: character(0).

output_format

character, output file format. One of "csv", "tsv", or "parquet". Default: "csv".

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.

population_data

data frame with columns "location" and "population".

column_selection

Columns to include in the output table. Uses tidy selection. Default: tidyselect::everything().

Value

invisibly returns the file path where data was written