Learn R Programming

ENMTools (version 1.0.5)

clamp.env: Takes an emtools.model object and a set of environment layers and clamps the environment layers so that no variable falls outside of the range available in the training data.

Description

Takes an emtools.model object and a set of environment layers and clamps the environment layers so that no variable falls outside of the range available in the training data.

Usage

clamp.env(model, env)

Arguments

model

An enmtools.model object. Alternatively the analysis.df component of an enmtools.model object.

env

A raster or raster stack of environmental data.

Value

An enmtools model object containing species name, model formula (if any), model object, suitability raster, marginal response plots, and any evaluation objects that were created.

Examples

Run this code
# NOT RUN {
data(euro.worldclim)
data(iberolacerta.clade)
monticola.gam <- enmtools.gam(iberolacerta.clade$species$monticola, euro.worldclim[[c(1,5,9,13)]])
euro.clamped <- clamp.env(monticola.gam, euro.worldclim)
clamped.prediction <- predict(monticola.gam, euro.clamped)
raster::plot(clamped.prediction$suitability - monticola.gam$suitability)
# }

Run the code above in your browser using DataLab