Learn R Programming

EcoSimR (version 0.1.0)

sim8: Sim8 Co-occurrence Randomization Algorithm

Description

Randomizes a binary matrix speciesData by reshuffling all elements. Columns are proportional to column sums, and rows are proportional to row sums. Makes a call to the vector_sample function.

Usage

sim8(speciesData)

Arguments

speciesData
binary presence-absence matrix (rows = species, columns = sites).

Value

Returns a binary presence-absence matrix with the same dimensions and fill as the input matrix.

Details

This algorithm assumes that the probability that a species occurs in a site is depends on the joint independent probability of randomly selecting the species and randomly selecting the site, with these probabilities set proportional to row and column sums of the matrix.

References

Gotelli, N.J. 2000. Null model analysis of species co-occurrence patterns. Ecology 81: 2606-2621.

Ulrich, W. and N.J. Gotelli. 2012. A null model algorithm for presence- absence matrices based on proportional resampling. Ecological Modelling 244:20-27.

Examples

Run this code
randomMatrix <- sim8(speciesData = matrix(rbinom(40,1,0.5),nrow=8))

Run the code above in your browser using DataLab