Description Usage Arguments Value Author(s) See Also Examples
Simulation of ecological data structured by two ecological gradients
1 2 3 4 5 6 7 8 | simul.comm.2(totS = 300, gr1.length = 5000, gr2.length = 5000,
niche.type = "random", max.niche.breath = c(gr1.length, gr2.length),
min.niche.breath = c(10, 10), prop.random.species = c(0, 0),
seed = NULL, plotting = F, highlight.species = NULL)
sample.comm.2(simul.comm = simul.comm.2(), Np = 300, sample.x1 = NULL,
sample.x2 = NULL, no.ind = 100, k = 0.2, seed = NULL, pa = FALSE,
based.on = "individuals", standardize.rowsums = TRUE)
|
totS |
total number of species in simulation |
gr1.length, gr2.length |
length of first and second gradient in units |
niche.type |
shape of species response curves ('random', 'normal', 'skewed') |
max.niche.breath |
vector of the length = 2, with maximum niche breath along first and second gradient (default = |
min.niche.breath |
vector of the length = 2, with minimum niche breath along the first and second gradient (default = |
prop.random.species |
Proportion of random species, i.e. species which are not related to any gradient. Should be vector with two elements, each being a real number from [0,1]. These species are generated by randomizing occurrence of given proportion of species among samples. Default = c(0,0). |
seed |
set random seed for reproducing always the same result |
plotting |
should the species response curves along simulated gradient be drawned? Default = |
highlight.species |
vector of species numbers which should be highlighted by color in ploted diagram (if |
simul.comm |
result of simul.comm.2 function with parameters of individual species response curves |
Np |
number of samples |
sample.x1, sample.x2 |
positions of sampling along the first (or second, respectively) gradient (default = NULL, means that random locations are generated) |
no.ind |
mean number of individuals to be drawn from the species pool (if |
k |
mean proportion of species from species pool to be drawn into local community (if |
pa |
result table will be generated in presence-absence form (default |
based.on |
should the sampling of species from species pool be based on |
standardize.rowsums |
Standardizes the abundances of species in samples so as the sum of species abundances in sample is 100 (standardizes to rowsums equal to 100). Applies only if |
The function simul.comm.2
returns list
with 18 items, describing the set of parameters used to simulate community of species response curves:
totS
Total number of species in simulation.
gr1.length, gr2.length
Length of the first and second gradient, respectively.
niche.type
Shape of species response curves.
Ao1, Ao2
Vector of species amplitudes for the first and second gradient, respectively (heights of species response curves, corresponding to maximum probability of species to be selected to community in species optima).
m1, m2
Vector of species optima along the first and second gradient, respectively.
r1, r2
Vector of generated species ranges along the first and second gradient, respectively (generated niche breaths).
range1, range2
Vector of realised species ranges along the first and second gradient, respectively, considering the truncation of species response curves by gradient margins (these differ from r1
and r2
especially at the gradient margins, where the generated species niche may be wide, but since the margin cuts the species occurrences, realised species niche is narrower.)
a1, a2, g1, g2
Vectors of shape parameters for curves (used in beta function to generate the shape of the species response curve)
A1.all, A2.all
Matrix (dim = gradient length x number of species) with simulated probabilites of individual specie at individual location along the gradient.
The function sample.comm.2
returns list
of 8 items with parameters of generated community data; the last item contains also all items returned by simul.comm.2
function:
a.mat
Matrix (sample x species) of species abundances in samples.
p.mat
Matrix (sample x species) of species occurrence probabilities in samples.
sample.x1, sample.x2
Vector with positions of samples along the first and second simulated gradient, respectively (environmental variable).
sample.comm
List of 7 items storing initial settings of arguments in sample.comm.2
(namely arguments Np, based.on, no.ind, k, seed, pa
and standardize.rowsums
).
simul.comm
List of 18 items returned by function simul.comm.2
.
David Zeleny (zeleny.david@gmail.com) - based on the script of Jason Fridley (Fridley et al. 2007, Appendix S2), modified for two dimensions
1 2 3 4 5 6 7 8 9 10 | sc <- sample.comm.2 (simul.comm.2 (gr1.length = 5000, gr2.length = 3000, totS = 100),
Np = 200, pa = FALSE, seed = 123)
library (vegan)
nmds <- metaMDS (sc$a.mat)
par (mfrow = c(1,2))
ordiplot (nmds, display = 'si', main = 'Environmental gradient 1')
points (nmds, display = 'si', cex = scale (sc$sample.x1, center = FALSE)*2, pch = 21, bg = 'white')
ordiplot (nmds, display = 'si', main = 'Environmental gradient 2')
points (nmds, display = 'si', cex = scale (sc$sample.x2, center = FALSE)*2, pch = 21, bg = 'white')
par (mfrow = c(1,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.