modOverlap | R Documentation |
This function calculates the degree of overlap between the predictions of two models, using niche comparison metrics such as Schoener's D, Hellinger distance and Warren's I.
modOverlap(pred1, pred2, na.rm = TRUE)
pred1 |
numeric vector or SpatRaster layer of the predictions of a model, with values between 0 and 1. |
pred2 |
numeric vector or SpatRaster layer of the predictions of another model, also with values between 0 and 1; must be of the same dimensions and in the same order as 'pred1'. |
na.rm |
logical value indicating whether NA values should be removed prior to calculation. The default is TRUE. |
See Warren et al. (2008).
This function returns a list of 3 metrics:
SchoenerD |
Schoener's (1968) D statistic for niche overlap, varying between 0 (no overlap) and 1 (identical niches). |
WarrenI |
the I index of Warren et al. (2008), based on Hellinger distance (below) but re-formulated to also vary between 0 (no overlap) and 1 (identical niches). |
HellingerDist |
Hellinger distance (as in van der Vaart 1998, p. 211) between probability distributions, varying between 0 and 2. |
A. Marcia Barbosa
Schoener T.W. (1968) Anolis lizards of Bimini: resource partitioning in a complex fauna. Ecology 49: 704-726
van der Vaart A.W. (1998) Asymptotic statistics. Cambridge Univ. Press, Cambridge (UK)
Warren D.L., Glor R.E. & Turelli M. (2008) Environmental niche equivalency versus conservatism: quantitative approaches to niche evolution. Evolution, 62: 2868-83 (and further ERRATUM)
fuzSim
; fuzzyOverlay
; niche.overlap
in package phyloclim; ecospat.niche.overlap
in package ecospat
# get an environmental favourability model for a rotifer species:
data(rotif.env)
names(rotif.env)
fav_current <- multGLM(rotif.env, sp.cols = 18, var.cols = 5:17,
step = TRUE, FDR = TRUE, trim = TRUE, P = FALSE, Fav = TRUE) $
predictions
# imagine you have a model prediction for this species in a future time
# (here we will create one by randomly jittering the current predictions)
fav_imag <- jitter(fav_current, amount = 0.2)
fav_imag[fav_imag < 0] <- 0
fav_imag[fav_imag > 1] <- 1
# calculate niche overlap between current and imaginary future predictions:
modOverlap(fav_current, fav_imag)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.