| linearPred | R Documentation |
This function will take the diversity matrix and the environmental distance matrix as input, and calculate the stability of each site using linear model. The stability is calculated by comparing the predicted distance (based on the linear model) and the mean measured distance (based on vegdist function).
linearPred(comdist, envdist, sitenames = NULL)
comdist |
The community dissimilarity matrix |
envdist |
The environmental dissimilarity matrix |
sitenames |
The names of the site |
a column vector of predicted stability values for each site
library(vegan)
library(stats)
data(varespec)
data(varechem)
example.comdist <- vegdist(varespec)
example.envdist <- dist(
BBmisc::normalize(
varechem,
method = "range",
margin = 2
),
method = "euclidean"
)
example.stability_LM <- linearPred(example.comdist, example.envdist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.