merge_pred_and_obs: Merge Forecast Data And Observations

View source: R/utils_data_handling.R

merge_pred_and_obsR Documentation

Merge Forecast Data And Observations

Description

The function more or less provides a wrapper around merge that aims to handle the merging well if additional columns are present in one or both data sets. If in doubt, you should probably merge the data sets manually.

Usage

merge_pred_and_obs(
  forecasts,
  observations,
  join = c("left", "full", "right"),
  by = NULL
)

Arguments

forecasts

data.frame with the forecast data (as can be passed to score()).

observations

data.frame with the observations

join

character, one of c("left", "full", "right"). Determines the type of the join. Usually, a left join is appropriate, but sometimes you may want to do a full join to keep dates for which there is a forecast, but no ground truth data.

by

character vector that denotes the columns by which to merge. Any value that is not a column in observations will be removed.

Value

a data.frame with forecasts and observations

Examples

forecasts <- example_quantile_forecasts_only
observations <- example_truth_only
merge_pred_and_obs(forecasts, observations)

scoringutils documentation built on Feb. 16, 2023, 7:30 p.m.