Learn R Programming

BiodiversityR (version 2.7-2)

evaluation.strip.data: Evaluation strips for ensemble suitability mapping

Description

These functions provide a dataframe which can subsequently be used to evaluate the relationship between environmental variables and the fitted probability of occurrence of individual or ensemble suitability modelling algorithms. The biomod2 package provides an alternative implementation of this approach (response.plot2).

Usage

evaluation.strip.data(xn = NULL, ext = NULL, models.list = NULL, input.weights = models.list$output.weights, vars = models.list$vars, factors = models.list$factors, dummy.vars = models.list$dummy.vars, steps=50 )
evaluation.strip.plot(data, TrainData=NULL, modelnames = c("MAXENT", "GBM", "GBMSTEP", "RF", "GLM", "GLMSTEP", "GAM", "GAMSTEP", "MGCV", "MGCVFIX", "EARTH", "RPART", "NNET", "FDA", "SVM", "SVME", "BIOCLIM", "DOMAIN", "MAHAL"), variable = NULL, model = NULL, dev.new.width = 7, dev.new.height = 7, ... )

Arguments

xn
RasterStack object (stack) containing all layers that correspond to explanatory variables of an ensemble calibrated earlier with ensemble.test. See also predict.
ext
an Extent object to limit the prediction to a sub-region of xn and the selection of background points to a sub-region of x, typically provided as c(lonmin, lonmax, latmin, latmax); see also predict, randomPoints and extent
models.list
list with 'old' model objects such as MAXENT or RF.
input.weights
array with numeric values for the different modelling algorithms; if NULL then values provided by parameters such as MAXENT and GBM will be used. As an alternative, the output from ensemble.test.splits can be used.
vars
Vector that indicates which variables should be included as columns in the data frame. Only variables that correspond to layers of the rasterStack will be included.
factors
vector that indicates which variables are factors; see also prepareData and ensemble.formulae
dummy.vars
vector that indicates which variables are dummy variables (coded 0 or 1 to indicate presence of specific level of a categorical variable; see also ensemble.formulae
steps
number of steps within the range of a continuous explanatory variable
data
data set with ranges of environmental variables and fitted suitability models, typically returned by evaluation.strip.data
TrainData
Data set representing the calibration data set. If provided, then a boxplot will be added for presence locations via boxplot
modelnames
abbreviated names of the individual suitability models that are fitted
variable
focal explanatory variable for plots with evaluation strips
model
focal model for plots with evaluation strips
dev.new.width
Width for new graphics device (dev.new). If < 0, then no new graphics device is opened.
dev.new.height
Heigth for new graphics device (dev.new). If < 0, then no new graphics device is opened.
...
Other arguments passed to plot

Value

function evaluation.strip.data creates a data frame, function codeevaluation.strip.data allows for plotting.

Details

These functions are mainly intended to be used internally by the ensemble.raster function.

evaluation.strip.data creates a data frame with variables (columns) corresponding to the environmental variables encountered in the RasterStack object (x) and the suitability modelling approaches that were defined. The variable of focal.var is an index of the variable for which values are ranged. The variable of categorical is an index for categorical (factor) variables.

A continuous (numeric) variable is ranged between its minimum and maximum values in the number of steps defined by argument steps. When a continuous variable is not the focal variable, then the average (mean) is used.

A categorical (factor) variable is ranged for all the encountered levels (levels) for this variable. When a categorical variable is not the focal variable, then the most frequent level is used.

References

Elith J, Ferrier S, Huettmann F & Leathwick J. 2005. The evaluation strip: A new and robust method for plotting predicted responses from species distribution models. Ecological Modelling 186: 280-289

See Also

ensemble.raster

Examples

Run this code
## Not run: 
# 
# # get predictor variables
# library(dismo)
# predictor.files <- list.files(path=paste(system.file(package="dismo"), '/ex', sep=''),
#     pattern='grd', full.names=TRUE)
# predictors <- stack(predictor.files)
# # subset based on Variance Inflation Factors
# predictors <- subset(predictors, subset=c("bio5", "bio6", 
#     "bio16", "bio17", "biome"))
# predictors
# predictors@title <- "base"
# 
# # presence points
# presence_file <- paste(system.file(package="dismo"), '/ex/bradypus.csv', sep='')
# pres <- read.table(presence_file, header=TRUE, sep=',')[,-1]
# 
# # the kfold function randomly assigns data to groups; 
# # groups are used as calibration (1/5) and training (4/5) data
# groupp <- kfold(pres, 5)
# pres_train <- pres[groupp !=  1, ]
# pres_test <- pres[groupp ==  1, ]
# 
# # choose background points
# ext <- extent(-90, -32, -33, 23)
# background <- randomPoints(predictors, n=1000, ext=ext, extf=1.00)
# colnames(background)=c('lon', 'lat')
# groupa <- kfold(background, 5)
# backg_train <- background[groupa != 1, ]
# backg_test <- background[groupa == 1, ]
# 
# # calibrate the models
# ensemble.calibrate <- ensemble.test(x=predictors, ext=ext,
#     p=pres_train, a=backg_train, 
#     pt=pres_test, at=backg_test,
#     ENSEMBLE.min=0.6,
#     MAXENT=1, GBM=1, GBMSTEP=1, RF=1, GLM=1, GLMSTEP=1, GAM=1, 
#     GAMSTEP=1, MGCV=1, MGCVFIX=1, EARTH=1, RPART=1, NNET=1, FDA=1, 
#     SVM=1, SVME=1, BIOCLIM=1, DOMAIN=1, MAHAL=1,
#     Yweights="BIOMOD", factors="biome",
#     PLOTS=FALSE, models.keep=TRUE)
# 
# # obtain data for plotting the evaluation strip
# strip.data <- evaluation.strip.data(xn=predictors, ext=ext,
#     models.list=ensemble.calibrate$models)
# 
# # create graphs
# evaluation.strip.plot(data=strip.data, variable="bio6", type="o", col="red")
# evaluation.strip.plot(data=strip.data, 
#     TrainData=ensemble.calibrate$models$TrainData,
#     variable="bio6", type="o", col="red")
# evaluation.strip.plot(data=strip.data, model="ENSEMBLE", type="o", col="red")
# evaluation.strip.plot(data=strip.data, 
#     TrainData=ensemble.calibrate$models$TrainData,
#     model="ENSEMBLE", type="o", col="red")
# 
# ## End(Not run)

Run the code above in your browser using DataLab