predictions_cardsR/predictions_cards.R
    as.predictions_cards.RdSeveral methods are provided to convert external forecasts given as a
data.frame into predictions_cards objects compatible with the various
evaluation and plotting functions.
as.predictions_cards(x, ...) # S3 method for predictions_cards as.predictions_cards(x, ...) # S3 method for data.frame as.predictions_cards( x, forecaster = "forecaster", forecast_date = lubridate::today(), incidence_period = c("epiweek", "day"), data_source = "data_source", signal = "signal", target_end_date = NULL )
| x | Object to be converted. See Methods section below for details on formatting of each input type. | 
|---|---|
| ... | Additional arguments passed to methods. | 
| forecaster | The name of the forecaster that produced this data. | 
| forecast_date | Date object or string of the form "YYYY-MM-DD",
indicating date on which forecasts will be made about some period (e.g.,
epiweek). For example, if  | 
| incidence_period | String indicating the incidence period, either "epiweek" or "day". | 
| data_source | The name of the data_source for the forecast target. | 
| signal | The name of the signal for the forecast target. | 
| target_end_date | The date the forecast target is observed (combines
 | 
Long data frame of forecasts with a class of predictions_cards.
The first 4 columns are the same as those returned by the forecaster. The
remainder specify the prediction task, 10 columns in total:
ahead, geo_value, quantile, value, forecaster, forecast_date,
data_source, signal, target_end_date, and incidence_period. Here
data_source and signal correspond to the response variable only.
predictions_cards: Simply returns the predictions_cards object
unchanged.
data.frame: The input data frame x must contain the
columns ahead, geo_value, quantile and value. Addional columns
forecaster forecast_date, incidence_period, data_source,
signal, and target_end_date will be created if missing.
Other columns will be preserved as-is.