| prediction_change_sdm | R Documentation |
Provides an automate way for the visualization of projections gain, loss, and stability between different scenarios.
prediction_change_sdm(i, scenario = NULL, ensemble_type = NULL, species = NULL, th = 0.5)
i |
A |
scenario |
Character. One of the scenarios that were projected. Can be ensembles as well. |
ensemble_type |
Character. Type of ensemble to be used. Standard is NULL, but will return the mean_occ_prob |
species |
Character. Species to be analyzed. Standard is NULL. |
th |
Numeric. Threshold to binarize the ensemble. |
A plot with comparison between current and other scenario.
Luíz Fernando Esser (luizesser@gmail.com) https://luizfesser.wordpress.com
species_names scenarios_names
if (interactive()) {
# Create sdm_area object:
set.seed(1)
sa <- sdm_area(parana, cell_size = 100000, crs = 6933)
# Include predictors:
sa <- add_predictors(sa, bioc)
# Include scenarios:
sa <- add_scenarios(sa, scen) |> select_predictors(c("bio1", "bio12"))
# Create occurrences:
oc <- occurrences_sdm(occ, crs = 6933) |> join_area(sa)
# Create input_sdm:
i <- input_sdm(oc, sa)
# Pseudoabsence generation:
i <- pseudoabsences(i, method="random", n_set = 2)
# Custom trainControl:
ctrl_sdm <- caret::trainControl(method = "boot",
number = 1,
classProbs = TRUE,
returnResamp = "all",
summaryFunction = summary_sdm,
savePredictions = "all")
# Train models:
i <- train_sdm(i,
algo = c("naive_bayes"),
ctrl=ctrl_sdm,
variables_selected = c("bio1", "bio12")) |>
suppressWarnings()
# Predict models:
i <- predict_sdm(i, th=0.8)
# Ensemble GCMs:
i <- gcms_ensembles(i, gcms = c("ca", "mi"))
i
# Change Analysis
prediction_change_sdm(i, scenario = "_ssp585_2090", ensemble_type = "mean_occ_prob")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.