new_QuantileForecastMatrix_from_df: Translate from a tidy data frame of forecasts to a wide...

View source: R/QuantileForecastMatrix.R

new_QuantileForecastMatrix_from_dfR Documentation

Translate from a tidy data frame of forecasts to a wide matrix representation suitable for use by calc_qra_from_matrices

Description

Translate from a tidy data frame of forecasts to a wide matrix representation suitable for use by calc_qra_from_matrices

Usage

new_QuantileForecastMatrix_from_df(
  forecast_df,
  model_col,
  id_cols,
  quantile_name_col,
  quantile_value_col,
  drop_missing_id_levels = FALSE
)

Arguments

forecast_df

data frame of forecasts from component models in 'CDC format'

model_col

character name of column in forecast_df identifying model

id_cols

character vector of columns in forecast_df identifying unique forecast settings such as location, time zero, and horizon

quantile_name_col

character name of column in forecast_df containing probability for quantile, e.g. 0.95

quantile_value_col

character name of column in forecast_df identifying value for quantile, e.g. 195

drop_missing_id_levels

logical. If FALSE, all combinations of unique values found in columns specified by id_cols are included, with NA values where corresponding forecasts are not provided. If TRUE, only the combinations of values for id_cols in the data frame are retained.

Value

Object of class QuantileForecastMatrix


reichlab/covidEnsembles documentation built on Jan. 31, 2024, 7:21 p.m.