Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

BIOMOD_LoadModels

Load models built within BIOMOD_Modeling function


Description

This function was implemented to help biomod2 users to load individual models built during the BIOMOD_Modeling step.

Usage

BIOMOD_LoadModels(bm.out, ... )

Arguments

bm.out

a "BIOMOD.models.out" returned by BIOMOD_Modeling

...

additional arguments (see details)

Details

This function is particularly useful when you plane to make some response plot analyses. It will induce models, built at BIOMOD_Modeling step, loading in your working space.

If you run this function referencing only bm.out argument, all models built will be loaded. However, you can make a models subselection using the additional arguments (see below).

Additional arguments (...) : All the following arguments are optional.

  • models: a character vector defining the names of models (e.g c(‘GLM’, ‘GAM’, ‘RF’) ) you want to load (models subselection)

  • run.eval: a character vector defining the names of evaluation run (e.g c(‘RUN1’, ‘Full’) ) you want to load (repetition subselection)

  • data.set: a character vector defining the names of data.set (e.g c(‘PA1’, ‘PA2’)) you want to load (pseudo absences subselection)

  • path: the path to file where the species folder is. To be filled if species folder is different from your working directory)

Value

A character vector filled with the loaded models names.

Note

SRE models are not supported yet. They will be automatically excluded even if they are selected.

Author(s)

Damien Georges

See Also

Examples

# species occurrences
DataSpecies <- read.csv(system.file("external/species/mammals_table.csv",
                                    package="biomod2"), row.names = 1)
head(DataSpecies)

# the name of studied species
myRespName <- 'GuloGulo'

# the presence/absences data for our species
myResp <- as.numeric(DataSpecies[,myRespName])

# the XY coordinates of species data
myRespXY <- DataSpecies[,c("X_WGS84","Y_WGS84")]


# Environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
myExpl = raster::stack( system.file( "external/bioclim/current/bio3.grd",
                     package="biomod2"),
                system.file( "external/bioclim/current/bio4.grd",
                             package="biomod2"),
                system.file( "external/bioclim/current/bio7.grd",
                             package="biomod2"),
                system.file( "external/bioclim/current/bio11.grd",
                             package="biomod2"),
                system.file( "external/bioclim/current/bio12.grd",
                             package="biomod2"))

# 1. Formatting Data
myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
                                     expl.var = myExpl,
                                     resp.xy = myRespXY,
                                     resp.name = myRespName)


# 2. Defining Models Options using default options.
myBiomodOption <- BIOMOD_ModelingOptions()

# 3. Doing Modelisation

myBiomodModelOut <- BIOMOD_Modeling( myBiomodData,
                                       models = c('RF'),
                                       models.options = myBiomodOption,
                                       NbRunEval=2,
                                       DataSplit=70,
                                       models.eval.meth = c('TSS'),
                                       SaveObj = TRUE,
                                       do.full.models = FALSE)

# 4. Loading some models built

myLoadedModels <- BIOMOD_LoadModels(myBiomodModelOut, models='RF')

myLoadedModels

biomod2

Ensemble Platform for Species Distribution Modeling

v3.4.6
GPL-2
Authors
Wilfried Thuiller [aut, cre], Damien Georges [aut, cre], Robin Engler [aut], Frank Breiner [aut]
Initial release
2020-02-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.