Learn R Programming

phytools (version 0.7-20)

ltt: Creates lineage-through-time plot (including extinct lineages)

Description

The function ltt computes LTT plot with extant and extinct lineages, and optionally conducts \(\gamma\)-test of Pybus & Harvey (2000). The object returned by ltt can be plotted or re-plotted using plot.

The function gtt computes the value of Pybus & Harvey's \(\gamma\) statistic through time by slice the tree at various points - by default in even intervals from the time above the root at which N = 3 to the present day.

The function mccr performs the MCCR test of Pybus & Harvey (2000) which takes into account incomplete taxon sampling in computing a P-value of the \(\gamma\) statistic.

Usage

ltt(tree, plot=TRUE, drop.extinct=FALSE, log.lineages=TRUE, gamma=TRUE, ...)
gtt(tree, n=100, ...)
mccr(obj, rho=1, nsim=100, ...)

Arguments

tree

is a phylogenetic tree in "phylo" format, or an object of class "multiPhylo" containing a list of phylogenetic trees.

plot

a logical value indicating whether or not to create LTT plot.

drop.extinct

logical value indicating whether or not to drop extinct tips from the tree.

log.lineages

logical value indicating whether LTT plot should be on log-linear (default) or linear-linear scale.

gamma

logical value indicating whether or not to compute eqngamma from Pybus & Harvey (2000; Proc. Roy. Soc. B).

n

for gtt the number of time intervals to use to track \(\gamma\) through time.

obj

for mccr an object of class "ltt".

rho

for mccr sampling fraction.

nsim

for mccr number of simulations to use for the MCCR test.

...

other arguments to be passed to plotting methods. See plot.default.

Value

ltt returns an object of class "ltt" which includes the following components:

times

a vector of branching times.

ltt

a vector of linages.

gamma

optionally, a value for the gamma-statistic.

p

two-tailed P-value for the gamma-test.

If tree is an object of class "multiPhylo", then an object of class "multiLtt" is returned consisting of a list of object of class "ltt". gtt returns an object of class "gtt". mccr returns of object of class "mccr".

Details

Although it is calculated here, it's unclear how to interpret the \(\gamma\)-statistic if not all the tips in the tree are contemporaneous.

References

Pybus, O. G., and P. H. Harvey (2000) Testing macro-evolutionary models using incomplete molecular phylogenies. Proc. R. Soc. Lond. B, 267, 2267-2272.

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

See Also

gammatest, ltt95

Examples

Run this code
# NOT RUN {
trees<-pbtree(n=100,scale=100,nsim=10)
obj<-ltt(trees,plot=FALSE)
plot(obj,log="y",log.lineages=FALSE,main="lineage through time plots")
tree<-pbtree(b=1,d=0.25,t=4)
obj<-ltt(tree,gamma=FALSE)
obj
# }

Run the code above in your browser using DataLab