gamPred: calculation of stability using an generalized additive model.

View source: R/gamPred.R

gamPredR Documentation

calculation of stability using an generalized additive model.

Description

This function will take the community count table and the environmental metadata table as input, and calculate the stability of each site using a generalized additive model (GAM). Alternatively, if no dissimilarity matrix of the community is provided, the function will calculate the community dissimilarity based on Bray-Curtis distance and use it. In GAM, the prediction results are expected to perform better than the linear models.

Usage

gamPred(
  comtable,
  envmeta,
  comdist = NULL,
  sitenames = NULL,
  GAM.dist.method = "manhattan"
)

Arguments

comtable

The community table

envmeta

The environmental metadata table/matrix

comdist

The community dissimilarity matrix (optional, default: NULL)

sitenames

The names of the site (optional, default: NULL)

GAM.dist.method

The method for calculating dist (default: "manhattan")

Value

a column vector of predicted stability values for each site

Examples

library(vegan)
data(varespec)
data(varechem)
example.stability_GAM <- gamPred(varespec, varechem)


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