spm_smooth | R Documentation |
With a formula, smooth a variable in a sspm dataset. See Details for more explanations.
spm_smooth(
sspm_object,
formula,
boundaries,
keep_fit = TRUE,
predict = TRUE,
...
)
## S4 method for signature 'sspm_dataset,formula,sspm_discrete_boundary'
spm_smooth(
sspm_object,
formula,
boundaries,
keep_fit = TRUE,
predict = TRUE,
...
)
sspm_object |
[sspm_dataset] An object of class sspm_dataset. |
formula |
[formula] A formula definition of the form response ~ smoothing_terms + ... |
boundaries |
[sspm_boundary] An object of class sspm_discrete_boundary. |
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). |
... |
Arguments passed on to
|
This functions allows to specify a model formula for a given discrete sspm
object. The formula makes use of specific smoothing terms smooth_time()
,
smooth_space()
, smooth_space_time()
. The formula can also contain fixed
effects and custom smooths, and can make use of specific smoothing terms
smooth_time()
, smooth_space()
, smooth_space_time()
.
An updated sspm_dataset.
## Not run:
biomass_smooth <- biomass_dataset %>%
spm_smooth(weight_per_km2 ~ sfa + smooth_time(by = sfa) +
smooth_space() +
smooth_space_time(),
boundaries = bounds_voronoi,
family = tw)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.