linearPred: calculation of stability using linear prediction model.

View source: R/linearPred.R

linearPredR Documentation

calculation of stability using linear prediction model.

Description

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).

Usage

linearPred(comdist, envdist, sitenames = NULL)

Arguments

comdist

The community dissimilarity matrix

envdist

The environmental dissimilarity matrix

sitenames

The names of the site

Value

a column vector of predicted stability values for each site

Examples

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)


betaStability documentation built on June 5, 2026, 5:08 p.m.