vegandevs / vegan

R package for community ecologists: popular ordination methods, ecological null models & diversity analysis
https://vegandevs.github.io/vegan/
GNU General Public License v2.0
455 stars 98 forks source link

How to to combine multiple community datasets and one environmental variables dataset? #329

Closed mlvermeire closed 5 years ago

mlvermeire commented 5 years ago

Dear Vegan community, Thank you very much for developing this great tool! I would like to ask for some advice for my current research. I am analyzing the effect of fire and herbivores on soil microbial populations, using 16S and ITS metabarcoding, for bacteria and fungi, respectively. I would like to combine my bacterial and fungal communities, but also a nematode dataset and an insects dataset, to run a "soil food web analysis" in relation with the environmental variables and the 2 treatments (fire and herbivory). I use a lot the R packages vegan and phyloseq, which both require one "community" data set and one "environmental" data set. Is there a way to use more than one community data set ? Would you have some advice on how to run this analysis?

Thank you very much in advance for your help !

jarioksa commented 5 years ago

vegan has no specific tools for handling multiple community matrices, but you should be able to structure your data into one community data. I don't know packages that can handle several data set except cocorresp for Co-Correspondence Analysis.

gavinsimpson commented 5 years ago

cocorresp can handle pairs of community matrices only. There is also cointeria() in the ade4 package which fits a linear flavour of the CoCA model in cocorresp.

I also think that ade4 has functions for doing k-way analysis vis co-interia and other analyses. See mdpca() in that package and the associated help file which has a link to a paper using a genetic example of multiple tables.

That said, the idea doesn't seem to be to combine the tables into one, but to rather look for common directions of variance across the k tables.