Keep only the latest contiguous time series, dropping all other NA values from the response variable. Removes test column variables first.
Arguments
- df
Data frame of model data.
- response
Column name of response variable to be used as the input to the forecast function.
- sort_col
Column name of column to arrange data by in
dplyr::arrange()
, prior to filtering for latest contiguous time series and producing the forecast. Not used ifNULL
, defaults to"year"
.- sort_descending
Logical value on whether the sorted values from
sort_col
should be sorted in descending order. Defaults toFALSE
.- test_col
Name of logical column specifying which response values to remove for testing the model's predictive accuracy. If
NULL
, ignored. Seemodel_error()
for details on the methods and metrics returned.