View source: R/bm_PlotVarImpBoxplot.R
bm_PlotVarImpBoxplot | R Documentation |
This function represents boxplot of variables importance of species distribution
models, from BIOMOD.models.out
or BIOMOD.ensemble.models.out
objects that can be obtained from BIOMOD_Modeling
or
BIOMOD_EnsembleModeling
functions. Scores are represented according to 3
grouping methods (see Details).
bm_PlotVarImpBoxplot(
bm.out,
group.by = c("run", "expl.var", "algo"),
do.plot = TRUE,
...
)
bm.out |
a |
group.by |
a 3-length |
do.plot |
(optional, default |
... |
some additional arguments (see Details) |
...
can take the following values :
main
: a character
corresponding to the graphic title
A list
containing a data.frame
with variables importance and the corresponding
ggplot
object representing them in boxplot.
Damien Georges, Maya Gueguen
BIOMOD.models.out
, BIOMOD.ensemble.models.out
,
BIOMOD_Modeling
, BIOMOD_EnsembleModeling
,
get_variables_importance
Other Secundary functions:
bm_BinaryTransformation()
,
bm_CrossValidation()
,
bm_FindOptimStat()
,
bm_MakeFormula()
,
bm_ModelingOptions()
,
bm_PlotEvalBoxplot()
,
bm_PlotEvalMean()
,
bm_PlotRangeSize()
,
bm_PlotResponseCurves()
,
bm_PseudoAbsences()
,
bm_RunModelsLoop()
,
bm_SRE()
,
bm_SampleBinaryVector()
,
bm_SampleFactorLevels()
,
bm_Tuning()
,
bm_VariablesImportance()
Other Plot functions:
bm_PlotEvalBoxplot()
,
bm_PlotEvalMean()
,
bm_PlotRangeSize()
,
bm_PlotResponseCurves()
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)
}
# ---------------------------------------------------------------
# Get variables importance
get_variables_importance(myBiomodModelOut)
# Represent variables importance
bm_PlotVarImpBoxplot(bm.out = myBiomodModelOut, group.by = c('expl.var', 'algo', 'algo'))
bm_PlotVarImpBoxplot(bm.out = myBiomodModelOut, group.by = c('expl.var', 'algo', 'PA'))
bm_PlotVarImpBoxplot(bm.out = myBiomodModelOut, group.by = c('algo', 'expl.var', 'PA'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.