motmot (version 2.1.3)

chr.disp.sim: Simulate character displacement data

Description

Simulates data under a Brownian motion or character displacement model

Usage

chr.disp.sim(
  phy,
  n.steps = 1000,
  sigma = 1,
  a = 0,
  ntraits = 1,
  sympatry = NA,
  allopatry = NA,
  trait.lim = NA
)

Arguments

phy

An object of class phylo (see ape).

n.steps

Number of time steps the for the simulation (default = 1000 time steps).

sigma

The value of Brownian variance in the simulation

a

The strength of competition between inter-specific lineages

ntraits

Number of traits to be simulated

sympatry

an optional matrix giving the time that each pair of species starts to interact

allopatry

an optional matrix giving the times when species stop interacting

trait.lim

an optional parameter that puts limits on the available trait-space, preventing trait values with magnitude greater than the value of lim

Value

A list containing the the simulated data (tval) showing the sigma, a, mean gap and gap standard deviation. Additionally, if used, the user input sympatry (symp) and/or allopatry (allo) matrices

References

Clarke M, Thomas GH, Freckleton RP. 2017. Trait evolution in adaptive radiations: modelling and measuring interspecific competition on phylogenies. The American Naturalist. 189, 121-137.

See Also

chr.disp.param, chr.disp.lrt

Examples

Run this code
# NOT RUN {
## import finch data form Clarke et al. (2017)
data(finches)
emp.tree <- finch.tree
emp.data <- finch.data
## simulate small amount of data 
## (example only - many more datasets are required for accuracy)
sim.data <- chr.disp.sim(emp.tree, n.steps=100,
sigma=1, a=2, ntraits=1, sympatry=NA, allopatry=NA, trait.lim=NA)
# }

Run the code above in your browser using DataLab