A function to create 1 through n lags of a set of variables. Is used as a data preparation helper function and is called internally by forecast_univariate, forecast_multivariate, and forecast_combine.
n.lag(Data, lags, variables = NULL)data.frame: data frame of variables to lag and a 'date' column
int: number of lags to create
string: vector of variable names to lag, default is all non-date variables
data.frame