simulation.experiment: Runs simulation experiments with VirtualCom

Description Usage Arguments Details Value See Also Examples

Description

This function creates (1) a species pool (see create.pool), (2) assembles communities (see tamaure) and (3) computes functional and phylogenetic diversity indices. After natural communities are assembled invasion can occur.

Usage

1

Arguments

parameters

The only argument is a named vector of input parameter values, the entries are given in details

Details

n.species.pool

number of species in the species pool (including native and invasive species)

evol.model

choice of the trait evolution model (see also create.pool)

evol.model.param

parameterization of the trait evolution model (see also create.pool)

species.pool.abundance

vector of abundances in the species pool; if NA then all species are equally abundant

min.phyl.signal

minimum value of phylogenetic signal in species pool (see also create.pool)

years

number of simulated timesteps; If plots=TRUE equilibrium conditions can be checked by eye

n.communities

number of simulated communities

env

value of the environment in the simulated community (e.g. temperature)

K

value of carrying capacity, i.e. number of individuals in the community

niche.breadth

value of standard deviation of the Gaussian distribution that describes the niche traits (identical for all species)

beta.env

value of the strength of the environmental filter (see details)

beta.comp

value of the strength of the competition filter (see details)

beta.abun

value of the strength of the recruitment filter, i.e. the advantage of already being present in the community (see also tamaure)

invasion.time

number of time-steps to simulate invasion (after native community has established); if 0 than there is no invasion

n.invader.pool

number of invaders in species pool

InvDistrib

The invader's distribution in the phylogney can be either clusterd ("1"), random ("2") or overdispersed ("3)

n.rep.null.model

number of repetitions for null models to test the diversity indices describing community composition

null.model

different null models can be choosen, see details

The following null models can be choosen to test for the structure of the native community: "1" = taxa.labels,"2" = richness, "3" = frequency, "4" = independentswap, "5" = trialswap. These models are explained in more detail in the function ses.mpd in the package picante. The output lists for natives and invaders consist of 5 matrices describing the diversity structure. They contain information on (1) observed diversity, and based on the chosen null models: (2) z-scores, (3) ranks, (4) mean of the null distribution and (5) standard deviation of the null distribution. Each matrix gives this information for all sites and for a set of diversity indices (mpd, mntd, ...).

Value

Information on input parameters, species pool, native assembly structure and invader assembly structure are returned as a list:

parameter

a vector of the input parameters

pool

a list of different objects that define the species pool. "func" is a dataframe of trait values and invader identity. "phylo" is a phylo object. "invader" is a list of the invader's ID, their niche optima and their performances given the environment in the community

natives

a list of the native commuity structure and diversity measures. "all.abundances" is a site-by-species matrix of abundances. "indices" is a list of matrices containing functional and phylohgenetic diversity information (see details)

invaders

a list of community structure and diversity measures after the invasion processes, see "natives" for the structure

See Also

tamaure for the community assembly function

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
26
27
28
29
30
# load pre-prepared parameter table
  data(simple_param)
  # run the first line of the parameter table
  single.run <- simulation.experiment(simple_param[1,]) # run the first line
  str(single.run)

  # setting up a full experiment (this may take a few minutes)
  wrapper <- function(a){
  library(VirtualCom)
  data(simple_param)
  print(a)
  return(try(simulation.experiment(simple_param[a,])))
  }

  # running the experiment either with lapply
  output <- lapply(1:nrow(simple_param), wrapper)

  # # or running the experiment with sfLapply using snowfall to allow for parallel computing
  # require(snowfall)
  # sfInit(parallel=TRUE, cpus=11)
  # output <- sfLapply(1:nrow(simple_param), wrapper)
  # sfStop()

  # extract results from list
  result.table <- get.results(output=output, myvar="obs", invader="FALSE")
  result.table$process <- ifelse(result.table$beta.env==0 & result.table$beta.comp==0, "Random", ifelse(result.table$beta.env!=0 & result.table$beta.comp==0, "Env", ifelse(result.table$beta.env==0 & result.table$beta.comp!=0, "Comp", "Both") ))

  # plot the funtional diversity (mpd) of communities in dependence on assembly processes
  require(ggplot2)
  ggplot(data=result.table, aes(x=process, y=FD_ab_mpd)) + geom_boxplot(width=0.8) +  xlab("Assembly rules") +  ylab("Functional diversity")

VirtualCom documentation built on May 2, 2019, 5:49 p.m.