Learn R Programming

biomod2 (version 4.1-2)

BIOMOD.formated.data: BIOMOD_FormatingData() output object class

Description

Class returned by BIOMOD_FormatingData, and used by BIOMOD_Tuning, BIOMOD_CrossValidation and BIOMOD_Modeling

Usage

# S4 method for 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
)

# S4 method for 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 )

# S4 method for 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 )

# S4 method for numeric,RasterStack BIOMOD.formated.data( sp, env, xy = NULL, dir.name = ".", sp.name = NULL, eval.sp = NULL, eval.env = NULL, eval.xy = NULL, na.rm = TRUE )

# S4 method for BIOMOD.formated.data,missing plot(x, coord = NULL, col = NULL)

# S4 method for BIOMOD.formated.data show(object)

Arguments

sp

a vector, SpatialPoints (if presence-only) or SpatialPointsDataFrame 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)

env

a matrix, data.frame, SpatialPointsDataFrame or RasterStack object containing the explanatory variables (in columns or layers) that will be used to build the species distribution model(s)

xy

(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)

dir.name

a character corresponding to the modeling folder

sp.name

a character corresponding to the species name

eval.sp

(optional, default NULL)
A vector, SpatialPoints (if presence-only) or SpatialPointsDataFrame 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

eval.env

(optional, default NULL)
A matrix, data.frame, SpatialPointsDataFrame or RasterStack object containing the explanatory variables (in columns or layers) that will be used to evaluate the species distribution model(s) with independent data

eval.xy

(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

na.rm

(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

data.mask

a RasterStack object containing the mask of the studied area

x

a BIOMOD.formated.data.PA object

coord

a 2-columns data.frame containing X and Y coordinates for plot

col

a vector containing colors for plot (default : c('green', 'red', 'orange', 'grey'))

object

a BIOMOD.formated.data.PA object

Slots

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 RasterStack 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

Author

Damien Georges

See Also

BIOMOD_FormatingData, BIOMOD_Tuning, BIOMOD_CrossValidation, BIOMOD_Modeling, bm_RunModelsLoop

Other Toolbox objects: BIOMOD.ensemble.models.out, BIOMOD.formated.data.PA, BIOMOD.models.options, BIOMOD.models.out, BIOMOD.projection.out, BIOMOD.stored.data, biomod2_ensemble_model, biomod2_model

Examples

Run this code

showClass("BIOMOD.formated.data")

## ----------------------------------------------------------------------- #

# Load species occurrences (6 species available)
myFile <- system.file('external/species/mammals_table.csv', package = 'biomod2')
DataSpecies <- read.csv(myFile, row.names = 1)
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)
myFiles <- paste0('external/bioclim/current/bio', c(3, 4, 7, 11, 12), '.grd')
myExpl <- raster::stack(system.file(myFiles, package = 'biomod2'))

# \dontshow{
myExtent <- raster::extent(0,30,45,70)
myExpl <- raster::stack(raster::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)



Run the code above in your browser using DataLab