Learn R Programming

phylolm (version 2.0)

rTrait: Continuous trait simulation

Description

Simulates a continuous trait along a tree from various phylogenetic models.

Usage

rTrait(phy, model = c("BM", "OU", "lambda","kappa", "delta",
              "EB", "trend"), parameters = NULL)

Arguments

phy
a phylogenetic tree of type phylo with branch lengths.
model
a phylogenetic model. Default is "BM", for Brownian motion. Alternatives are "OU", "lambda", "kappa", "delta", "EB" and "trend".
parameters
List of parameters for the model (see Note).

Value

  • A numeric vector with names from the tip labels in the tree.

encoding

latin1

Details

Possible phylogenetic models are the Brownian motion model (BM), the Ornstein-Uhlenbeck model (OU), Pagel's lambda model (lambda), Pagel's kappa model (kappa), Pagel's delta model (delta), the Early Burst model (EB), and the Brownian motion model with a trend (trend).

See Also

rTraitCont.

Examples

Run this code
tre = rtree(50)
y = rTrait(phy=tre,model="OU", parameters=list(
             optimal.value=2,sigma2=1,alpha=0.1))

Run the code above in your browser using DataLab