BIOMOD_FormatingData(resp.var,
expl.var,
resp.xy = NULL,
resp.name = NULL,
eval.resp.var = NULL,
eval.expl.var = NULL,
eval.resp.xy = NULL,
PA.nb.rep = 0,
PA.nb.absences = 1000,
PA.strategy = 'random',
PA.dist.min = 0,
PA.dist.max = NULL,
PA.sre.quant = 0.025,
PA.table = NULL,
na.rm = TRUE)
SpatialPointsDataFrame
(or SpatialPoints
if you work with matrix
, data.frame
, SpatialPointsDataFrame
or RasterStack
containing your explanatory variables matrix
containing the X and Y coordinates of resp.var (only consider if resp.var is a vector) that will be used to build your models.SpatialPointsDataFrame
your species data (a single species) in binary format (ones for presences, zeros for true absences and NA for indeterminated ) that will be used to evalumatrix
, data.frame
, SpatialPointsDataFrame
or RasterStack
containing your explanatory variables matrix
containing the X and Y coordinates of resp.var (only consider if resp.var is a vector) that will be used to evaluate the modelswith independant data (or past data for instance).matrix
(or a data.frame
) having as many rows than resp.var
values. Each column correspund to a Pseudo-absences selection. It contains TRUE
or FALSE
indicating which values of resp.v
'data.formated.Biomod.object'
for BIOMOD_Modeling
.
It is strongly advised to check whether this formated data corresponds to what was expected. A summary is easily printed by simply tipping the name of the object. A generic plot function is also available to display the different dataset in the geographic space.PA.dist.min
), respectively a maximal (PA.dist.max
) distance to presences points for selecting your pseudo absences candidates. That may be usefull if you don't want to select pseudo-absences too close to your presences (same niche and to avoid pseudo-replication), respectively too far from your presences (localised sampling startegy).PA.sre.quant
) of presences data. It forces pseudo absences to be selected outside of the broadly defined environemental conditions for the species. It means that a surface range envelop model (sre, similar the BIOCLIM) is first carried out (using the specified quantile) on the species of interest, and then the pseudo-absence data are extracted outside of this envelop. This particular case may lead to over optimistic models evaluations.data.frame
(e.g. PA.table
argument)PA.strategy
PA.nb.absences
.rasterLayer
or rasterStack
objects, SpatialPointsDataFrame
, the same requirements are asked than for the raster objects. The XY coordinates must be given to make sure biomod2 can extract the explanatory variables onto the presence (absence) data
When the explanatory variables are stored in a data.frame, make sure there are in the same order than the response variable.
BIOMOD_FormatingData
concerns a single species at a time so resp.var
must be a uni-dimentional object.
Response variable must be a vector
or a one column data.frame
/matrix
/SpatialPointsDataFrame
( SpatialPoints
are also allowed if you work with resp.var
argument, the data should be coded in the following way :
resp.var
is a non-spatial object (vector
, matrix
/data.frame
) and that some models requiring spatial data are being used (e.g. MAXENT) and/or pseudo absences spatialy dependent (i.e 'disk'), make sure to give the XY coordinates of the sites/rows (BIOMOD_Modeling
# 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 = 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)
myBiomodData
plot(myBiomodData)
Run the code above in your browser using DataLab