View source: R/clamp_predictors.R
clamp_predictors | R Documentation |
This function clamps the environmental variables in a terra::SpatRaster
or terra::SpatRasterDataset
so that their minimum and maximum values do
not exceed the range in the training dataset.
clamp_predictors(x, training, .col, use_na)
## Default S3 method:
clamp_predictors(x, training, .col, use_na)
## S3 method for class 'stars'
clamp_predictors(x, ...)
## S3 method for class 'SpatRaster'
clamp_predictors(x, training, .col, use_na = FALSE)
## S3 method for class 'SpatRasterDataset'
clamp_predictors(x, training, .col, use_na = FALSE)
x |
a |
training |
the training dataset (a |
.col |
the column containing the presences (optional). If specified, it is excluded from the clamping. |
use_na |
a boolean determining whether values outside the range of the training dataset are removed (set to NA). If FALSE (the default), values outside the training range are replaced with the extremes of the training range. |
... |
additional arguments specific to a given object type |
a terra::SpatRaster
or terra::SpatRasterDataset
clamped to
the ranges in training
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.