Skip to contents

This function is used to shift the start times and lead times of forecasts to simulate lagging.

Usage

shift_forecast(
  .fcst,
  fcst_shifts,
  keep_unshifted = FALSE,
  drop_negative_lead_times = TRUE
)

Arguments

.fcst

A harp_fcst object as created by read_point_forecast, or a data frame with columns including 'fcdate' (in seconds) and 'leadtime' (in hours).

fcst_shifts

A named list with names that exist in '.fcst' or a single numeric value to apply to all forecast models. If a list, each element must be numeric and of length 1 as only 1 shift can be applied to each forecast. The shifts are specified in hours. Postive values will shift the forecast start dates forward in time and reduce the lead times by the corresponding amounts. Negative values will do the opposite.

Value

An object of the same class as '.fcst' with the forecast start times and lead times shifted for the forecast models and number hours given in 'fcst_shifts'.