BIOMOD_LoadModels {biomod2} | R Documentation |
Load species distribution models built with biomod2
Description
This function loads individual models built with BIOMOD_Modeling
or BIOMOD_EnsembleModeling
functions.
Usage
BIOMOD_LoadModels(
bm.out,
full.name = NULL,
PA = NULL,
run = NULL,
algo = NULL,
merged.by.PA = NULL,
merged.by.run = NULL,
merged.by.algo = NULL,
filtered.by = NULL
)
Arguments
bm.out |
a |
full.name |
(optional, default |
PA |
(optional, default |
run |
(optional, default |
algo |
(optional, default |
merged.by.PA |
(optional, default |
merged.by.run |
(optional, default |
merged.by.algo |
(optional, default |
filtered.by |
(optional, default |
Details
This function might be of particular use to load models and make response plot analyses.
Running the function providing only bm.out
argument will load all models built by the
BIOMOD_Modeling
or BIOMOD_EnsembleModeling
function, but a
subselection of models can be done using the additional arguments (full.name
, PA
,
run
, algo
, merged.by.PA
, merged.by.run
, merged.by.algo
,
filtered.by
).
Value
A vector
containing the names of the loaded models.
Author(s)
Damien Georges
See Also
BIOMOD_Modeling
, BIOMOD_EnsembleModeling
Other Main functions:
BIOMOD_EnsembleForecasting()
,
BIOMOD_EnsembleModeling()
,
BIOMOD_FormatingData()
,
BIOMOD_Modeling()
,
BIOMOD_Projection()
,
BIOMOD_RangeSize()
Examples
library(terra)
# Load species occurrences (6 species available)
data(DataSpecies)
head(DataSpecies)
# Select the name of the studied species
myRespName <- 'GuloGulo'
# Get corresponding presence/absence data
myResp <- as.numeric(DataSpecies[, myRespName])
# Get corresponding XY coordinates
myRespXY <- DataSpecies[, c('X_WGS84', 'Y_WGS84')]
# Load environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
data(bioclim_current)
myExpl <- terra::rast(bioclim_current)
# ---------------------------------------------------------------
file.out <- paste0(myRespName, "/", myRespName, ".AllModels.models.out")
if (file.exists(file.out)) {
myBiomodModelOut <- get(load(file.out))
} else {
# Format Data with true absences
myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
expl.var = myExpl,
resp.xy = myRespXY,
resp.name = myRespName)
# Model single models
myBiomodModelOut <- BIOMOD_Modeling(bm.format = myBiomodData,
modeling.id = 'AllModels',
models = c('RF', 'GLM'),
CV.strategy = 'random',
CV.nb.rep = 2,
CV.perc = 0.8,
OPT.strategy = 'bigboss',
metric.eval = c('TSS','ROC'),
var.import = 3,
seed.val = 42)
}
# ---------------------------------------------------------------
# Loading some models built
BIOMOD_LoadModels(bm.out = myBiomodModelOut, algo = 'RF')