Learn R Programming

ENMTools (version 1.0.5)

enmtools.calibrate: Takes an emtools.model object, and reformats it to run through the CalibratR package, calculates Continuous Boyce Index, and runs a Hosmer-Lemeshow goodness-of-fit test. Can either do a full CalibratR run or just return ECE/MCE statistics and plots.

Description

Takes an emtools.model object, and reformats it to run through the CalibratR package, calculates Continuous Boyce Index, and runs a Hosmer-Lemeshow goodness-of-fit test. Can either do a full CalibratR run or just return ECE/MCE statistics and plots.

Usage

enmtools.calibrate(
  model,
  recalibrate = FALSE,
  cuts = 11,
  env = NA,
  n.background = 10000,
  ...
)

Arguments

model

An enmtools.model object

recalibrate

When TRUE, does a full CalibratR "calibrate" run to recalibrate the model. When FALSE, just returns metrics and plots measuring calibration of the model as is.

cuts

The number of bins to split suitability scores into for calculating calibration.

env

A set of environment layers to be used for optional env space metrics

n.background

Number of background points to be used for env space metrics

...

Further arguments to be passed to CalibratR's "calibrate" function.

Value

An enmtools.calibrate object containing calibration and classificaction plots, metrics of model calibration, and (optionally) versions of the model that were recalibrated using various methods.

Examples

Run this code
# NOT RUN {
install.extras(repos='http://cran.us.r-project.org')
data(euro.worldclim)
data(iberolacerta.clade)
monticola.glm <- enmtools.glm(iberolacerta.clade$species$monticola,
                              env = euro.worldclim,
                              f = pres ~ bio1 + bio9,
                              test.prop = 0.3)
enmtools.calibrate(monticola.glm)
# }

Run the code above in your browser using DataLab