This functions is now used internally to map a formula onto a sspm_dataset
or sspm
object.
map_formula(data_frame, boundaries, formula, time, ...)
# S4 method for sf,ANY,formula
map_formula(data_frame, boundaries, formula, time, ...)
# S4 method for ANY,missing,ANY
spm_smooth(
sspm_object,
formula,
boundaries,
keep_fit = TRUE,
predict = TRUE,
...
)
# S4 method for ANY,ANY,missing
spm_smooth(
sspm_object,
formula,
boundaries,
keep_fit = TRUE,
predict = TRUE,
...
)
# S4 method for ANY,ANY,sspm_boundary
spm_smooth(
sspm_object,
formula,
boundaries,
keep_fit = TRUE,
predict = TRUE,
...
)
[sf data.frame] The data.
[sspm_boundary] An object of class sspm_discrete_boundary.
[formula] A formula definition of the form response ~ smoothing_terms + ...
[character] The time column.
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
).
[sspm_dataset] An object of class sspm_dataset.
[logical] Whether or not to keep the fitted values and model (default to TRUE, set to FALSE to reduce memory footprint).
[logical] Whether or not to generate the smoothed predictions (necessary to fit the final SPM model, default to TRUE).
The updated object.