Learn R Programming

phytools (version 2.5-2)

fastBM: (Reasonably) fast quantitative trait simulation on phylogenies

Description

Simulates one or multiple continuous traits on the tree under various evolutionary models.

Usage

fastBM(tree, a=0, mu=0, sig2=1, bounds=c(-Inf,Inf), internal=FALSE, nsim=1, 
   ...)

Arguments

Value

A vector (for nsim=1) or matrix containing the tip states for the n species in the tree, and (optionally) the ancestral states for internal nodes.

Details

This function conducts (reasonably) fast quantitative trait simulation on a phylogeny under several different models: Brownian motion (default), BM with a trend (for mu!=0), bounds (for bounds!=c(-Inf, Inf)), and OU.

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

See Also

sim.corrs

Examples

Run this code
## load example tree
data(anoletree)

## simulate 10 characters on the Anolis tree 
## under Brownian motion
X<-fastBM(anoletree,nsim=10)
head(X)

## create a plot
phylo.heatmap(anoletree,X,fsize=c(0.4,0.8,0.8),
    standardize=TRUE,colors=terrain.colors(n=20))

Run the code above in your browser using DataLab