Search code examples
rvegan

How to calculate the checkerboard score (C-score) under a null model by vegan package in R


I recently want to follow the checkerboard score under a null model method to calculate the pvalue for co-occurrence analysis as adopted by this paper "Using network analysis to explore co-occurrence patterns in soil microbial communities".

Unfortunately, the usage of commands and arguments of vegan package was not well described in the paper.

I believe there must be some expert of vegan package in R to do such co-occurrence analysis based on checkerboard score under a null model.

Could any one help with the scripts or the commands and arguments I should use to calculate the C-score under a null model in R?

Will this C-score thing return me a matrix of pvalue that I could use to indicate the co-occurrence?


Solution

  • this should give a quick estimate of C-score

    library(vegan)
    library(bipartite)
    C.score(species, normalise=T, FUN=mean, na.rm=T)->cscore.speciesN
    C.score(species, normalise=F, FUN=mean, na.rm=T)->cscore.speciesS
    cscore.speciesN
    cscore.speciesS