map_formula: Map model formula onto a sspm_dataset object

map_formulaR Documentation

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 signature 'sf,ANY,formula'
map_formula(data_frame, boundaries, formula, time, ...)

## S4 method for signature 'ANY,missing,ANY'
spm_smooth(
  sspm_object,
  formula,
  boundaries,
  keep_fit = TRUE,
  predict = TRUE,
  ...
)

## S4 method for signature 'ANY,ANY,missing'
spm_smooth(
  sspm_object,
  formula,
  boundaries,
  keep_fit = TRUE,
  predict = TRUE,
  ...
)

## S4 method for signature 'ANY,ANY,sspm_boundary'
spm_smooth(
  sspm_object,
  formula,
  boundaries,
  keep_fit = TRUE,
  predict = TRUE,
  ...
)

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

Value

The updated object.

Examples

## Not run: 
map_formula(data_frame = all_data, boundaries = boundaries,
            formula = formula, time = time, ...)

## End(Not run)

pedersen-fisheries-lab/spaspm documentation built on Feb. 16, 2025, 7:39 p.m.