Class returned by BIOMOD_FormatingData
, and used by
bm_Tuning
, bm_CrossValidation
and
BIOMOD_Modeling
# S4 method for class 'numeric,data.frame'
BIOMOD.formated.data(
sp,
env,
xy = NULL,
dir.name = ".",
sp.name = NULL,
eval.sp = NULL,
eval.env = NULL,
eval.xy = NULL,
na.rm = TRUE,
data.mask = NULL,
shared.eval.env = FALSE,
filter.raster = FALSE
)
# S4 method for class 'data.frame,ANY'
BIOMOD.formated.data(
sp,
env,
xy = NULL,
dir.name = ".",
sp.name = NULL,
eval.sp = NULL,
eval.env = NULL,
eval.xy = NULL,
na.rm = TRUE,
filter.raster = FALSE
)
# S4 method for class 'numeric,matrix'
BIOMOD.formated.data(
sp,
env,
xy = NULL,
dir.name = ".",
sp.name = NULL,
eval.sp = NULL,
eval.env = NULL,
eval.xy = NULL,
na.rm = TRUE,
filter.raster = FALSE
)
# S4 method for class 'numeric,SpatRaster'
BIOMOD.formated.data(
sp,
env,
xy = NULL,
dir.name = ".",
sp.name = NULL,
eval.sp = NULL,
eval.env = NULL,
eval.xy = NULL,
na.rm = TRUE,
shared.eval.env = FALSE,
filter.raster = FALSE
)
# S4 method for class 'BIOMOD.formated.data'
show(object)
A vector
, a SpatVector
without associated
data (if presence-only), or a SpatVector
object containing binary data (0
: absence, 1
: presence,
NA
: indeterminate) for a single species that will be used to
build the species distribution model(s)
Note that old format from sp are still supported such as
SpatialPoints
(if presence-only) or SpatialPointsDataFrame
object containing binary data.
a matrix
, data.frame
, SpatVector
or SpatRaster
object containing the explanatory variables
(in columns or layers) that will be used to build the species distribution model(s).
Note that old format from raster and sp are still supported such as
RasterStack
and SpatialPointsDataFrame
objects.
(optional, default NULL
)
If resp.var
is a vector
, a 2-columns matrix
or data.frame
containing the corresponding X
and Y
coordinates that will be used to build the
species distribution model(s)
a character
corresponding to the modeling folder
a character
corresponding to the species name
(optional, default NULL
)
A vector
, a SpatVector
without associated
data (if presence-only), or a SpatVector
object containing binary data (0
: absence, 1
: presence,
NA
: indeterminate) for a single species that will be used to
evaluate the species distribution model(s) with independent data
Note that old format from sp are still supported such as
SpatialPoints
(if presence-only) or SpatialPointsDataFrame
object containing binary data.
(optional, default NULL
)
A matrix
, data.frame
, SpatVector
or
SpatRaster
object containing the explanatory
variables (in columns or layers) that will be used to evaluate the species
distribution model(s) with independent data
Note that old format from raster and sp are still
supported such as RasterStack
and SpatialPointsDataFrame
objects.
(optional, default NULL
)
If resp.var
is a vector
, a 2-columns matrix
or
data.frame
containing the corresponding X
and Y
coordinates that will be used to evaluate the species distribution model(s)
with independent data
(optional, default TRUE
)
A logical
value defining whether points having one or several missing
values for explanatory variables should be removed from the analysis or not
(optional, default NULL
)
A SpatRaster
object containing the mask of the studied area
(optional, default FALSE
)
A logical
value defining whether the explanatory variables used for the
evaluation dataset are the same than the ones for calibration (if eval.env
not
provided for example) or not
(optional, default FALSE
)
If env
is of raster type, a logical
value defining whether sp
is to be filtered when several points occur in the same raster cell
a BIOMOD.formated.data
object
dir.name
a character
corresponding to the modeling folder
sp.name
a character
corresponding to the species name
coord
a 2-columns data.frame
containing the corresponding X
and Y
coordinates
data.species
a vector
containing the species observations (0
, 1
or
NA
)
data.env.var
a data.frame
containing explanatory variables
data.mask
a SpatRaster
object containing the mask of the
studied area
has.data.eval
a logical
value defining whether evaluation data is given
eval.coord
(optional, default NULL
)
A 2-columns data.frame
containing the corresponding X
and Y
coordinates for evaluation data
eval.data.species
(optional, default NULL
)
A vector
containing the species observations (0
, 1
or NA
) for
evaluation data
eval.data.env.var
(optional, default NULL
)
A data.frame
containing explanatory variables for evaluation data
BIOMOD_FormatingData
, bm_Tuning
,
bm_CrossValidation
, BIOMOD_Modeling
,
bm_RunModelsLoop
Other Toolbox objects:
BIOMOD.ensemble.models.out
,
BIOMOD.formated.data.PA
,
BIOMOD.models.options
,
BIOMOD.models.out
,
BIOMOD.options.dataset
,
BIOMOD.options.default
,
BIOMOD.projection.out
,
BIOMOD.stored.data
,
biomod2_ensemble_model
,
biomod2_model
showClass("BIOMOD.formated.data")
## ----------------------------------------------------------------------- #
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)
DONTSHOW({
myExtent <- terra::ext(0,30,45,70)
myExpl <- terra::crop(myExpl, myExtent)
})
## ----------------------------------------------------------------------- #
# Format Data with true absences
myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
expl.var = myExpl,
resp.xy = myRespXY,
resp.name = myRespName)
myBiomodData
plot(myBiomodData)
summary(myBiomodData)