Learn R Programming

sspm (version 1.1.0)

map_formula: Map model formula onto a sspm_dataset object

Description

This functions is now used internally to map a formula onto a sspm_dataset or sspm object.

Usage

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, ... )

Value

The updated object.

Arguments

data_frame

[sf data.frame] The data.

boundaries

[sspm_boundary] An object of class sspm_discrete_boundary.

formula

[formula] A formula definition of the form response ~ smoothing_terms + ...

time

[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_object

[sspm_dataset] An object of class sspm_dataset.

keep_fit

[logical] Whether or not to keep the fitted values and model (default to TRUE, set to FALSE to reduce memory footprint).

predict

[logical] Whether or not to generate the smoothed predictions (necessary to fit the final SPM model, default to TRUE).

Examples

Run this code
if (FALSE) {
map_formula(data_frame = all_data, boundaries = boundaries,
            formula = formula, time = time, ...)
}

Run the code above in your browser using DataLab