Learn R Programming

expoTree (version 1.0.1)

plotLTT: 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()'.

References

Leventhal, Bonhoeffer, Guenthard & Stadler, 2012

See Also

expoTree

Examples

Run this code
  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)

Run the code above in your browser using DataLab