I have species' abundance data for different sites, and I'm basically interested in assessing whether indices derived from current assemblages are any different from indices derived from randomly generated communities. Right now my problem is that I can't find clear information on how to (1) generate random community matrices that only randomise the species present but keeps being matrices with abundance data and not just presence/absense; and (2) apply a function such that returns calculated indices for all these random communities, I'm interested in calculating functional diversity indices from packages such as FD or mFD, but any type of taxonomic or phylogenetic diversity index should serve just as well as an example.
I tried using the commsim and simulate functions from {vegan} package, but I only managed to generate random communities with presence/absense data. At this point I'm wholly confused with the help page for the function
library(vegan)
data("mite")
community<-mite
nm = vegan::nullmodel(x = community, method = "swap") #generated the dimensionality from my observed community matrix which is 35col by 75rows
sm = simulate(nm, nsim = 999)
If you want to find Mean Phylogenetic Distance (MPD) or Mean Nearest Taxon Distance (MNTD), you can use package
picante.The
runscomand is the number of random communities generated.