Last data update: 2014.03.03

R: Plot lineages through time.
plotLTTR Documentation

Plot lineages through time.

Description

Creates a (or adds to an existing) plot of the lineages-through-time of a list of phylogenetic trees.

Usage

plotLTT(trees,col=rgb(.5,.5,.5,.5),xlab="Time", ylab="Lineages",log="y",add=FALSE,
        plot=TRUE,plot.tree=NA,type="s",...) 

Arguments

trees

A list of trees in two-column format. Column 1 is the branching/sampling time and column two is the event type (1 = branching, 0 = sampling)

col

Color of the lineages.

xlab

x-axis label.

ylab

y-axis label.

log

Use logarithmic axis (defaults to logarithmic y-axis).

add

Add the lineages to the current plotting device.

plot

If set to FALSE, only the number of lineages at each time point are returned.

plot.tree

Plot the phylogenetic tree in the background. Only works for one tree.

type

Line type. Defaults to steps 's'.

...

Other parameters to pass to 'plot()'.

Author(s)

Gabriel E Leventhal

References

Leventhal, Bonhoeffer, Guenthard & Stadler, 2012

See Also

expoTree

Examples

  N <- 100
  beta <- 1
  mu <- 0.1
  psi <- 0.4
  nsamp <- 100

  epis <- lapply(1:10,function(i) sim.epi(N,beta,mu,psi,nsamp))
  trees <- lapply(epis,function(x) cbind(x$times,x$ttypes))
  plotLTT(trees)

Results