plotLTT: Plot lineages through time.

Description Usage Arguments Author(s) References See Also Examples

View source: R/plotLTT.R

Description

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

Usage

1
2
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

1
2
3
4
5
6
7
8
9
  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)

Example output

Loading required package: ape
Loading required package: deSolve

expoTree documentation built on May 29, 2017, 3:49 p.m.