Skip to contents

Given a set of epiweekly quantile forecasts, format them for a hubverse submission

Usage

get_hubverse_table(
  quantile_forecasts,
  reference_date,
  target_name,
  quantile_value_col = "quantile_value",
  quantile_level_col = "quantile_level",
  location_col = "location",
  epiweek_col = "epiweek",
  epiyear_col = "epiyear",
  horizons = -1:3,
  reference_dow = 7,
  week_start = 7,
  excluded_locations = c("60", "78")
)

Arguments

quantile_forecasts

tidy data frame of quantile forecasts to format, which should have a location column, a column of quantile values, a column of quantile levels, a column indicating the epiweek, and a column indicating the epiyear.

reference_date

reference date for the hub forecast.

target_name

Name of the target for the table.

quantile_value_col

name of the column containing the quantile values. Default 'quantile_value' (the default output column name from trajectories_to_quantiles()).

quantile_level_col

name of the column indicating the quantile level. Default 'quantile_level' (the default output column name from trajectories_to_quantiles()).

location_col

name of the column containing the location value. Default 'location'.

epiweek_col

name of the column containing the epiweek. Default 'epiweek'.

epiyear_col

name of the column containing the epiyear. Default 'epiyear'.

horizons

Vector of forecast horizons to include, in weeks ahead of the reference_date. Default -1:3 (FluSight and Covidhub 2024/25 horizons).

reference_dow

Which day of the week should the reference_date be, as an integer? Default 7 (the last day of the week), which with the default value of week_start will be Saturday, i.e. the last day of a USA epidemiological week.

week_start

Starting day of the week relative to Monday, as an integer. Default 7, i.e. weeks that start on Sunday, as USA epidemiological weeks do. See the lubridate::wday() documentation for details.

excluded_locations

locations to exclude from the table Default c("60", "78") (American Samoa and the US Virgin Islands, for which FluSight does not currently accept forecasts).

Value

a properly formatted table, as a tibble.