Skip to contents

This helper writes a summary data frame to disk in the specified format.

Usage

write_ref_date_summary(
  summary_data,
  reference_date,
  hub_reports_path,
  disease,
  file_suffix,
  output_format = "csv",
  overwrite_existing = FALSE
)

Arguments

summary_data

Summary of forecast data for a given reference date, usually the output of summarize_ref_date_forecasts() after column selection. Must include: location_name, horizon, target, target_data_type, quantile_*, target_end_date, forecast_due_date, and model.

reference_date

character, the reference date for the forecast in YYYY-MM-DD format (ISO-8601).

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").

output_format

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

overwrite_existing

logical. If TRUE, overwrite existing files. Default: FALSE.

Value

invisibly returns the file path where data was written