This function is a wrapper around lag (note that not all arguments are supported). The default value for the lag is the mean of the series.
spm_lag(sspm_object, vars, n = 1, default = "mean", ...)
# S4 method for sspm
spm_lag(sspm_object, vars, n = 1, default = "mean", ...)
# S4 method for sspm_fit
spm_lag(sspm_object, vars, n = 1, default = "mean", ...)
[sspm_dataset] An object of class sspm_dataset.
[character] Names of the variables to lag.
Positive integer of length 1, giving the number of positions to lead or lag by
Value used for non-existent rows. Defaults to NA
.
a list of variables that are the covariates that this
smooth is a function of. Transformations whose form depends on
the values of the data are best avoided here: e.g. s(log(x))
is fine, but s(I(x/sd(x)))
is not (see predict.gam
).
Updated sspm_object
.