View source: R/PRE_FATE.speciesDistanceOverlap.R
PRE_FATE.speciesDistanceOverlap | R Documentation |
This script is designed to create a distance matrix between species, based on co-occurrence of species.
PRE_FATE.speciesDistanceOverlap(mat.overlap.option, mat.overlap.object)
mat.overlap.option |
a |
mat.overlap.object |
two options, depending on the value of
|
This function allows to obtain a distance matrix between species (1 - Schoeners D), based on niche overlap information :
If PCA
option is selected, the degree of niche overlap will
be computed using the ecospat.niche.overlap
.
If raster
option is selected, the degree of niche overlap will
be computed using the niche.overlap
.
A matrix
containing overlap distances between each pair
of species, calculated as 1 - Schoeners D
.
Maya Guéguen
ecospat.niche.overlap
,
niche.overlap
## Load example data
Champsaur_PFG = .loadData('Champsaur_PFG', 'RData')
## Prepare sites x species table
## Add absences in community sites
sites = Champsaur_PFG$sp.observations
tab.dom.PA = Champsaur_PFG$tab.dom.PA
for (si in sites$sites[which(sites$TYPE == "COMMUNITY")])
{
ind = which(rownames(tab.dom.PA) == si)
tab.dom.PA[ind, which(is.na(tab.dom.PA[ind, ]))] = 0
}
## Prepare environmental table
tab.env = Champsaur_PFG$tab.env
## Calculate niche overlap distances -----------------------------------------
list.over = list(tab.dom.PA[, 1:10], tab.env)
DIST.overlap = PRE_FATE.speciesDistanceOverlap(mat.overlap.option = "PCA"
, mat.overlap.object = list.over)
(DIST.overlap[1:5, 1:5])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.