Learn R Programming

phytools (version 0.2-40)

sim.rates: Brownian simulation with multiple evolutionary rates

Description

This function conducts BM simulation on a tree with multiple rates.

Usage

sim.rates(mtree, sig2, anc=0, nsim=1, internal=F, plot=F)

Arguments

mtree
is a stochastic map format phylogenetic tree in modified "phylo" format (e.g., see make.simmap).
sig2
a named vector containing the rates for each state; names should be states in mtree.
anc
optional value for the root state.
nsim
number of simulations.
internal
logical value indicating whether to return states at internal nodes.
plot
logical value indicating whether or not to visual the rate heterogeneity (default value is FALSE.

Value

  • a vector (for nsim=1) or matrix containing the tip states for the n species in the tree.

See Also

fastBM, make.simmap, read.simmap, sim.history