Random neutral ecosystem
rand.neutral.Rd
Given the size of the metacommunity \(J\), and the fundamental
biodiversity number \(\theta\), generate an object of class
count
using a stochastic mechanism consistent with the
neutral theory.
Arguments
- J
Size of metacommunity
- theta
Fundamental biodiversity number \(\theta\). User must supply exactly one of
theta
andprob.of.mutate
.- prob.of.mutate
Probability of mutation \(\nu\): \(\theta=2J\nu\).
- string
String to add to species names. By default (ie
string
beingNULL
), species are named “1”, “2”,\(\ldots\). Argumentstring
supplies a prefix for these species names; a good one to use is “spp.
”. This argument is useful because printing acount
object can be confusing if the species names are all integers.- pad
Boolean, with default
FALSE
meaning to return acount
object having only extant species, andTRUE
meaning to pad the count with extinct species toJ
species. Use this when a vector of lengthJ
is required consistently (see examples section).
References
S. P. Hubbell 2001. “The Unified Neutral Theory of Biodiversity”. Princeton University Press.
Examples
rand.neutral(1000, 9)
#> 2 4 10 16 6 8 1 11 12 18 7 14 25 9 5 13 26 20 17 19
#> 185 170 95 78 55 54 46 46 35 28 23 20 20 18 15 15 15 14 10 9
#> 15 24 29 23 27 34 3 21 28 30 37 22 31 32 33 35 36 38 39
#> 7 6 6 5 4 3 2 2 2 2 2 1 1 1 1 1 1 1 1
rand.neutral(1000, 9, string="spp.")
#> spp.6 spp.3 spp.1 spp.7 spp.19 spp.13 spp.11 spp.18 spp.9 spp.22 spp.5
#> 306 285 138 32 24 21 20 20 18 16 15
#> spp.8 spp.12 spp.10 spp.4 spp.20 spp.16 spp.21 spp.15 spp.23 spp.26 spp.27
#> 15 12 10 10 8 7 6 4 4 4 4
#> spp.17 spp.2 spp.24 spp.25 spp.34 spp.35 spp.14 spp.28 spp.29 spp.30 spp.31
#> 2 2 2 2 2 2 1 1 1 1 1
#> spp.32 spp.33 spp.36 spp.37
#> 1 1 1 1
data(butterflies)
rand.neutral(no.of.ind(butterflies), optimal.theta(butterflies),string="spp.")
#> spp.3 spp.5 spp.1 spp.4 spp.6 spp.13 spp.16 spp.24 spp.14 spp.8 spp.11
#> 68 55 40 27 21 20 16 16 13 10 9
#> spp.20 spp.19 spp.23 spp.15 spp.10 spp.12 spp.22 spp.17 spp.25 spp.28 spp.30
#> 9 8 7 6 5 5 5 4 4 4 4
#> spp.2 spp.9 spp.29 spp.7 spp.18 spp.21 spp.26 spp.27 spp.31 spp.32 spp.33
#> 3 3 2 2 1 1 1 1 1 1 1
#> spp.34 spp.35 spp.36
#> 1 1 1
# what is the distribution of abundance of the second ranked species if
# J=10, theta=0.7?
plot(table(replicate(100,rand.neutral(10,theta=0.7,pad=TRUE)[2])))