Skip to contents

Pivot a hubverse quantile table wider with columns representing individual quantile levels.

Usage

pivot_hubverse_quantiles_wider(
  hubverse_table,
  pivot_quantiles = c(point = 0.5, lower = 0.025, upper = 0.975)
)

Arguments

hubverse_table

hubverse-format forecast table to pivot, as a tibble

pivot_quantiles

quantiles to pivot to columns, as a vector or named vector. Default c("point" = 0.5, "lower" = 0.025, "upper" = 0.975), i.e. get the median and the central 95% interquantile interval, with names "point" for the median, "lower" for the 0.025th quantile, and "upper" for the 0.975th quantile.

Value

A pivoted version of the hubverse table in which each forecast for a given target, horizon, reference_date, and location corresponds to a single row with multiple value columns, one for each of the quantiles in pivot_quantiles, and named according to the corresponding names given in that vector, or generically as q_<quantile_level> if an unnamed numeric vector is provided. So with the default pivot_quantiles, the output will have three value columns named lower", "point", and "upper"