betasim: Simulate communities with specified diversity characteristics

Description Usage Arguments Examples

View source: R/betasim_funs.R

Description

Simulate communities with specified diversity characteristics

Usage

1
2
3
4
5
6
betasim(n.abund = 5, p.abund = 0.5, diff.abund = NULL, spcat = 2,
  totsp = 30, n.site = 3, n.indiv.site = 100, n.indiv.tot = NULL,
  p.mix = rep(0, n.abund), seed = NULL, rand = c("none", "multinom",
  "poisson", "trpoisson"), rarefy = 1, pred.spec = c("none", "focal",
  "abund"), pred.rand = c("binom", "none"), pred.gamma = -Inf,
  pred.alpha = 0, pred.gamma.sd = 0, no.zero.patch = TRUE)

Arguments

n.abund

number of abundance categories

p.abund

relative ranking of subsequent abundance categories

diff.abund

alternative parameterization: difference between most and least abundant category

spcat

number of species per abundance category PER SITE (overdetermined)

totsp

total species pool size (FIXME)

n.site

number of sites

n.indiv.site

individuals per site

n.indiv.tot

total number of individuals

p.mix

mixing parameter: probability of among-site mixing for each abundance category: 0=endemic, 1=homogeneous

seed

random number seed

rand

randomization type: 'none' to keep numbers==expected numbers; 'multinom' for fixed total per site; 'poisson' for Poisson sampling, 'trpoisson' for truncated Poisson sampling

rarefy

degree of rarefaction (1=none)

pred.spec

predator specification (stub?)

pred.rand

predator randomness

pred.gamma

predation intensity (-Inf==none)

pred.alpha

predator preference parameter; if pred.spec=="abund" 0=neutral, -1=pref. rare, +1=pref. common; if pred.spec=="focal" 0=neutral, -1=pref non-endemic, +1=pref endemic

pred.gamma.sd

patch-to-patch variability in predation intensity (0=none)

no.zero.patch

force all patches to have positive occupancy?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Use default values: 3 sites (rows) with a total of
## 30 species: 5 abundance classes x 2 species per site x 3 sites.
## By default there is no mixing among sites (100% beta diversity).
## The default plot (rows=sites, columns=species) shows that each site
## has blocks of 2 species from each abundance class (grayscale indicates
## prevalence). The default for \code{betasim} is to do a deterministic
## simulation, simply returning a matrix with the expected number of
## individuals of each species at each site.
set.seed(101)
b0 <- betasim()
plot(b0)
## Specify 100% mixing now all species are present at all sites in
## the same numbers:
plot(betasim(p.mix=1))
## Partial mixing:
plot(betasim(p.mix=0.5))
## Add Poisson randomness:
plot(betasim(p.mix=0.5,rand="poisson"))
## Change the number sites or the number of abundance classes: by
## default, spcat (number of species per site per abundance
## category) will be adapted to try to make the total number of species
## come out correctly (i.e. spcat will be set to
## totsp/(n.site*n.abund)).  If totsp is not an even multiple of
## n.site*n.abund, the results may be unpredictable.
plot(betasim(n.site=5,n.abund=3,p.mix=0.25,rand="poisson"))

bbolker/betararef documentation built on Sept. 17, 2021, 8:49 a.m.