rCommunity(n, size = sum(NorP), NorP = 1, BootstrapMethod = "Chao2015", S = 300,
Distribution = "lnorm", sd = 1, prob = 0.1, alpha = 40,
CheckArguments = TRUE)
"Marcon"
, the probabilities are simply the abundances divided by the total number of individuals (Marcon et al., 2012). If "lnorm"
(log-normal), "lseries"
(log-series), "geom"
(geometric) or "bstick"
(broken stick).TRUE
, the function arguments are verified. Should be set to FALSE
to save time when the arguments have been checked elsewhere.AbdVector
) if a single community has been drawn, or a MetaCommunity
containing simulated communities.size
are drawn in a multinomial distribution according to the distribution of probabilities provided by NorP
.
An abundance vector may be used instead of probabilities, then size
is by default the total number of individuals in the vector. Random communities are built by drawing in a multinomial law following Marcon et al. (2012), or trying to estimate the distribution of the actual community with as.ProbaVector
. If BootstrapMethod = "Chao2013"
, the distribution is estimated by a single parameter model and unobserved species are given equal probabilities. If BootstrapMethod = "Chao2015"
, a two-parameter model is used and unobserved species follow a geometric distribution.
Alternatively, the probabilities may be drawn following a classical distribution: either a lognormal ("lnorm"
) one (Preston, 1948) with given standard deviation (sd
; note that the mean is actually a normalizing constant. Its values is set equal to 0 for the simulation of the normal distribution of unnormalized log-abundances), a log-series ("lseries"
) one (Fisher et al., 1943) with parameter alpha
, a geometric ("geom"
) one (Motomura, 1932) with parameter prob
, or a broken stick ("bstick"
) one (MacArthur, 1957). The number of simulated species is fixed by S
.
Log-normal, log-series and broken-stick distributions are stochastic. The geometric distribution is completely determined by its parameters.SpeciesDistribution
and the program SimAssem
(Reese et al., 2013; not an R package) for more distributions.# Generate communities made of 100000 individuals among 300 species and fit them
par(mfrow = c(2,2))
for (d in c("lnorm", "lseries", "geom", "bstick")) {
rCommunity(n = 1, size = 1E5, S = 300, Distribution = d) -> AbdVec
plot(AbdVec, Distribution = d, main = d)
}
Run the code above in your browser using DataLab