lttPlot: Make a lineage through time (LTT) plot

View source: R/lttPlot.R

lttPlotR Documentation

Make a lineage through time (LTT) plot

Description

lttPlot plots the lineage through time (LTT) of a phylo object. It also adds a reference line connecting the edges of the graph.

Usage

lttPlot(
  phy,
  lwd = 1,
  col = "red",
  plot = TRUE,
  rel.time = FALSE,
  add = FALSE,
  knitr = FALSE
)

Arguments

phy

A phylo object, as specified by the ape package.

lwd

Line width.

col

Line color.

plot

A logical indicating with calculations should be plotted. If FALSE, function returns a list of the calculated points.

rel.time

A logical indicating how the time scale should be shown. If FALSE (default), plots the absolute time since phy's crown age. If TRUE, plots time as a relative proportion between crown age and furthest tip from root.

add

A logical indicating if plot should be added to pre-existing plot. Default is FALSE.

knitr

Logical indicating if plot is intended to show up in RMarkdown files made by the Knitr R package.

Value

Plots the sum of alive lineages per point in time, and adds a red line as a reference of expectation under pure birth. If plot = FALSE, a list the richness of each point in time, and phy's crown age.

Author(s)

Daniel Rabosky, Matheus Januario, Jennifer Auler

References

Paradis, E. (2012). Analysis of Phylogenetics and Evolution with R (Vol. 2). New York: Springer.

Examples


S <- 1
E <- 0
set.seed(1)
phy <- simulateTree(pars = c(S, E), max.taxa = 20, max.t = 5)
lttPlot(phy, knitr = TRUE)
lttPlot(phy, plot = FALSE, knitr = TRUE)


evolved documentation built on April 3, 2025, 9:23 p.m.