Here we present a basic vignette that runs through taking a species by sites matrix and performs a Bayesian Bootstrap Generalised Dissimilarity Model. Our vignette will run through the following steps:
# install.packages(c('devtools','vegan')) # devtools::install_github('skiptoniam/bbgdm')
library(bbgdm) library(vegan)
The dune meadow vegetation data, dune, has cover class values of 30 species on 20 sites. Make the abundance data presence/absence.
data(dune) data(dune.env) dune_pa <- ifelse(dune>0,1,0)
Now we have a species by sites matrix of simulated data and a set data for a one dimensional gradient.
form <- ~1+A1 fm1 <- bbgdm(form,dune_pa, dune.env,family="binomial",link='logit', dism_metric="number_non_shared",spline_type = 'ispline', nboot=100, geo=FALSE,optim.meth='nlmnib')
resids <- diagnostics(fm1) par(mfrow=c(2,2)) plot(resids)
response <- as.response(fm1) par(mfrow=c(1,1)) plot(response)
library(xtable) wt <- bbgdm.wald.test(fm1) tab <- xtable(wt) print(tab, type = "html")
Jongman, R.H.G, ter Braak, C.J.F & van Tongeren, O.F.R. (1987). Data Analysis in Community and Landscape Ecology. Pudoc, Wageningen.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.