sdm: Species distribution models for a range of algorithms

Description Usage Arguments Value References Examples

View source: R/sdm.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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
)

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

Value

A list with the following objects:

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

phyloregion documentation built on May 1, 2021, 9:06 a.m.