Learn R Programming

ENMTools (version 1.0)

enmtools.ppmlasso: Takes an emtools.species object with presence and background points, and builds a Point Process Model (with Lasso penalty)

Description

Takes an emtools.species object with presence and background points, and builds a Point Process Model (with Lasso penalty)

Usage

enmtools.ppmlasso(
  species,
  env,
  f = NULL,
  test.prop = 0,
  eval = TRUE,
  nback = 1000,
  env.nback = 10000,
  normalise = FALSE,
  report = NULL,
  overwrite = FALSE,
  rts.reps = 0,
  bg.source = "default",
  ...
)

Arguments

species

An enmtools.species object

env

A raster or raster stack of environmental data.

f

Standard R formula

test.prop

Proportion of data to withhold randomly for model evaluation, or "block" for spatially structured evaluation.

eval

Determines whether model evaluation should be done. Turned on by default, but moses turns it off to speed things up.

nback

Number of background points to draw from range or env, if background points aren't provided

env.nback

Number of points to draw from environment space for environment space discrimination metrics.

normalise

Should the suitability of the model be normalised? If FALSE (the default), suitability is returned as the predicted number of presence points in each grid cell (occurrence density). If TRUE, occurrence densities are divided by the total predicted density, to give a value ranging from 0 to 1, which represents the proportion of the predicted density for a species that occurs in each grid cell.

report

Optional name of an html file for generating reports

overwrite

TRUE/FALSE whether to overwrite a report file if it already exists

rts.reps

The number of replicates to do for a Raes and ter Steege-style test of significance

bg.source

Source for drawing background points. If "points", it just uses the background points that are already in the species object. If "range", it uses the range raster. If "env", it draws points at randome from the entire study area outlined by the first environmental layer.

...

Arguments to be passed to ppmlasso()

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.

Details

This runs a ppmlasso model of a species' distribution. It is generally recommended that background points should be on a grid for this method, as the background points are considered 'quadrature' points, used to estimate an integral. If background points are not provided, the function will generate them on a grid, rather than randomly, as is more usual for other SDM methods.

Examples

Run this code
# NOT RUN {
install.extras(repos='http://cran.us.r-project.org')
data(euro.worldclim)
data(iberolacerta.clade)
enmtools.ppmlasso(iberolacerta.clade$species$monticola, env = euro.worldclim[[1:3]])
# }

Run the code above in your browser using DataLab