simBMphylo: Creates a graphical illustration of Brownian motion evolution...

View source: R/simBMphylo.R

simBMphyloR Documentation

Creates a graphical illustration of Brownian motion evolution on a phylogeny

Description

Simulates a discrete time phylogeny and Brownian motion trait, and generates a plot.

Usage

simBMphylo(n, t, sig2, plot=TRUE, ...)
## S3 method for class 'simBMphylo'
plot(x, ...)

Arguments

n

number of taxa to simulate in the output tree.

t

total time for the simulation.

sig2

the rate of evolution under Brownian motion, \sigma^2, or a vector of rates. If the latter the length of the vector must exactly match t, otherwise the first element of sig2 will just be duplicated t times.

plot

optional logical value indicating whether or not the simulated object should be plotted.

...

optional arguments to be passed to the plot method.

x

in plot method, object of class "simBMphylo".

Details

The function simulates a discrete-time pure-birth phylogeny (for fixed N and t using rejection sampling) and then discrete-time Brownian motion on that tree. It then proceeds to generating a plot of the results.

Value

An object of class "simBMphylo" or a plot.

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also

bmPlot, fastBM, pbtree

Examples

set.seed(777)
simBMphylo(n=6,t=100,sig2=0.01)
## reset par to defaults
par(mfrow=c(1,1))
par(mar=c(5.1,4.1,4.1,2.1))

phytools documentation built on Nov. 10, 2023, 1:08 a.m.