Standardizes predictors by converting them into z-scores.
std_vars(pred, as_matrix = TRUE)
An object of class SpatRaster or matrix or data.frame
Logical. If TRUE a matrix will be returned
A matrix or SpatRaster of standarized predictors
if as_matrix is FALSE and pred is a SpatRaster, the function would return an SpatRaster object.
pred_path <- system.file("extdata/G_layers", package = "smop") |>
list.files(full.names=TRUE)
pred <- terra::rast(pred_path)
std_bios <- smop::std_vars(pred,as_matrix=FALSE)
terra::plot(std_bios)