Learn R Programming

phyloregion (version 1.0.6)

sdm: Species distribution models for a range of algorithms

Description

This function computes species distribution models using four modelling algorithms: generalized linear models, generalized boosted models, random forests, and maximum entropy (only if rJava is available). Note: this is an experimental function, and may change in the future.

Usage

sdm(
  x,
  pol = NULL,
  predictors = NULL,
  blank = NULL,
  res = 1,
  tc = 2,
  lr = 0.001,
  bf = 0.75,
  n.trees = 50,
  step.size = n.trees,
  k = 5,
  herbarium.rm = TRUE,
  n_points = 30
)

Value

A list with the following objects:

  • ensemble_raster The ensembled raster that predicts the potential species distribution.

  • ensemble_AUC The median AUCs of models.

  • data The dataframe that was used to implement the model.

  • indiv_models Raster layers for the separate models that predict the potential species distribution.

  • single_AUCs The AUCs for the seperate models.

Arguments

x

A dataframe containing the species occurrences and geographic coordinates. Column 1 labeled as "species", column 2 "lon", column 3 "lat".

pol

A polygon shapefile specifying the boundary to restrict the prediction. If not specified, a minimum convex polygon is estimated using the input data frame of species occurrences.

predictors

RasterStack of environmental descriptors on which the models will be projected

blank

A blank raster upon which the prediction layer is aggregated to.

res

Desired resolution of the predicted potential species distribution (if blank raster is not specified).

tc

Integer. Tree complexity. Sets the complexity of individual trees

lr

Learning rate. Sets the weight applied to individual trees

bf

Bag fraction. Sets the proportion of observations used in selecting variables

n.trees

Number of initial trees to fit. Set at 50 by default

step.size

Number of trees to add at each cycle

k

Number of groups

herbarium.rm

Logical, remove points within 50 km of herbaria.

n_points

Minimum number of points required to successfully run a species distribution model

References

Phillips, S.J., Anderson, R.P. & Schapire, R.E. (2006) Maximum entropy modeling of species geographic distributions. Ecological Modelling 190: 231-259.

Examples

Run this code
# \donttest{
library(raster)
# get predictor variables
f <- list.files(path=paste(system.file(package="phyloregion"), '/ex', sep=''),
                     pattern='.tif', full.names=TRUE )
preds <- stack(f)
#plot(preds)
# get species occurrences
d <- read.csv(system.file("ex/Bombax.csv", package="phyloregion"))

# fit ensemble model for four algorithms
mod <- sdm(d, predictors = preds)
# }

Run the code above in your browser using DataLab