Description Usage Arguments Value Examples
View source: R/binaryInitState.R
To generate a matrix of all possible combination of species presence (1) or
absence (0) as an initial state of the community. For a community of N
species, there are 2^N
possibilities.
1 |
N |
Total number of species in the community. |
A matrix of 2^NxN, with values 1 indicating the presence and 0 the absence of the species.
1 2 3 4 5 | # Generate all possible binary initial state of a 4 species community
mask <- binaryInitState(4)
initAbundance <- c(1, 3, 2, 4)
# Initial abundance for all 16 scenarios
allInitAbundance <- t(t(mask) * initAbundance)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.