simul.comm.2: Simulation of ecological data structured by two ecological...

Description Usage Arguments Value Author(s) Examples

View source: R/simul.comm.2.r

Description

Simulation of ecological data structured by two ecological gradients

Usage

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 = F,
  based.on = "individuals")

Arguments

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 = c(gr1.length, gr2.length))

min.niche.breath

vector of the length = 2, with minimum niche breath along the first and second gradient (default = c(10, 10)). Cannot be more than max.niche.breath.

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 = FALSE.

highlight.species

vector of species numbers which should be highlighted by color in ploted diagram (if plotting = TRUE). Default = NULL, which means that if plot is drawned, two species will be highlighted - the most generalized and the most specialized ones.

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 based.on = 'individuals')

k

mean proportion of species from species pool to be drawn into local community (if based.on = 'species')

pa

result table will be generated in presence-absence form (default pa = TRUE)

based.on

should the sampling of species from species pool be based on 'individuals' or 'species'? (default = 'individuals')

Value

The function simul.comm.2 returns list with 14 items, describing the set of parameters used to simulate community of species response curves:

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:

Author(s)

David Zeleny ([email protected]) - based on the script of Jason Fridley (Fridley et al. 2007, Appendix S2), modified for two dimensions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sc <- sample.comm.2 (simul.comm.2 (gr1.length = 5000, gr2.length = 3000, totS = 300),
 Np = 200, pa = FALSE, seed = 123)
library (vegan)
set.seed (1234)
nmds <- metaMDS (sc$a.mat, try = 1)
par (mfrow = c(1,2))
ordiplot (nmds, display = 'si', main = 'Environmental gradient 1', type = 'n')
points (nmds, display = 'si', cex = scale (sc$sample.x1, center = FALSE)*2, pch = 21, bg = 'white')
ordiplot (nmds, display = 'si', main = 'Environmental gradient 2', type = 'n')
points (nmds, display = 'si', cex = scale (sc$sample.x2, center = FALSE)*2, pch = 21, bg = 'white')

zdealveindy/weimea documentation built on Dec. 5, 2017, 11:25 p.m.