My data is a species co-occurrence matrix, I would like to generate randomized matrices in order to test co-occurence patterns.
The only function that I found for this type of analysis is the randomizeMatrix function in the R package picante. It works well, however the number of types of null models available in this function is limited.
Currently implemented null models (arguments to null.model):frequency(maintains species occurence frequency), richness (maintains sample species richness), independentswap and trialswap
Does anyone know of other functions or modifications to this function that will allow me to test other null models such as equiproabable or proportional column sums.
Here's how I'm using the function
> test <- matrix(c(1,1,0,1,0,1,0,0,1,0,0,1,0,1,0,0),nrow=4,ncol=4)
> test
[,1] [,2] [,3] [,4]
[1,] 1 0 1 0
[2,] 1 1 0 1
[3,] 0 0 0 0
[4,] 1 0 1 0
> randomizeMatrix(test,null.model = "richness",iterations = 1000)
[,1] [,2] [,3] [,4]
[1,] 1 1 0 0
[2,] 1 1 0 1
[3,] 0 0 0 0
[4,] 0 1 0 1
> randomizeMatrix(test,null.model = "independentswap",iterations = 1000)
[,1] [,2] [,3] [,4]
[1,] 1 0 1 0
[2,] 1 1 0 1
[3,] 0 0 0 0
[4,] 1 0 1 0
>
I run the function within a loop in order to get multiple iterations
Thank you in advance
vegan
package ... ? If you post a more specific definition of what you're after, someone might just write it for you here (e.g., generating the equiprobability case sounds pretty easy). You might also ask on the[email protected]
mailing list ... - Ben Bolker