Learn R Programming

clst (version 1.20.0)

prettyTree: Draw an annotated phylogenetic tree.

Description

Extends plot.phylo to draw a phylogenetic tree with additional annotation.

Usage

prettyTree(x, groups, fill,
           X, O, indices, labels,
           show = rep(TRUE, length(x)),
           largs = list(cex = 0.75, bty = "n", yjust = 0.5),
           parargs = list(mar = c(bottom = 5, left = 2, top = 2,
                              right = ifelse(is.null(largs), 2, 8)),
               xpd = NA),
           pointargs = list(), glyphs,
           shuffleGlyphs = NA, ...)

Arguments

x
an object of class phylo, eg x <- nj(ddist)
groups
a factor (or object coercible) to a factor assigning group identity to leaf nodes in x
fill
vector (logical or indices) of points to fill
X
vector of points to mark with an X
O
vector of points to mark with a circle
indices
label points with indices (all points if 'yes', or a subset indicated by a vector)
labels
character vector of tip labels in the same order as x$tip.label
show
boolean vector of points to show
largs
arguments controlling appearance of the legend or NULL for no legend
parargs
arguments to pass par()
pointargs
arguments to pass points() (other than pch, col, bg)
glyphs
a data.frame with columns named 'col' and 'pch' corresponding to elements of unique(groups)
shuffleGlyphs
NA or an integer (argument to set.seed)
...
passed to plot.phylo

Value

  • Plots to the active device; no return value.

Details

prettyTree adds to a plot drawn by plot.phylo

Vectors specifying annotation should be in the order of row or column labels of the distance matrix used to generate x.

See Also

plot.phylo

Examples

Run this code
library(ape)
data(seqs)
data(seqdat)
prettyTree(nj(dist.dna(seqs)), groups=seqdat$tax_name)

Run the code above in your browser using DataLab