HPDbars: Plot HPD Intervals on Time-calibrated Phylogenies

Description Usage Arguments Details Note Author(s) See Also Examples

Description

This function plots highest posterior density (HPD) intervals of node ages derived from BEAST (or other molecular dating) analyses. The default of the label argument works with objects generated by read.beast and read.beast.table.

Usage

1
2
HPDbars(phy, label = "height_95%_HPD", tab = NULL, nodes, 
	col, lwd, broken = FALSE, ...)

Arguments

phy

An object of class phylo.

label

A character string used to identify the columns or list elements for plotting (see details).

tab

A matrix, containg at least three columns.

nodes

A vector of mode numeric, giving the number of nodes for which HPD intervals will be plotted; if omitted, HPD intervals will be plotted for all nodes.

col

A character string, the color for the HPD bars

lwd

An integer, the thickness (line width) for the HPD bars

broken

Logical, if broken == TRUE, those HPDbars that project beyond the age of the root are depicted as 'broken' bars.

...

Further graphical parameters may also be supplied as arguments.

Details

The label argument identifies those two elements of a phylo object (if tab = NULL) or columns names of matrix (specified by the tab argument) that give upper and lowers bounds for ranges or HPDs. The upper and the lower bound have to be characterized by the additon of _MAX and_MIN to the label string. Hence, in a typical BEAST analysis, you can choose between "rate_range", "rate_95%_HPD", "height_range", and "height_95%_HPD" (the default) for label.

Note

Currently, HPDbars works only with plot.phylo(type = "phylogram").

Author(s)

Christoph Heibl

See Also

read.beast and read.beast.table to read BEAST/TreeAnnotaor output; plot.phylo.upon plots a phylogeny with 'transparent' background; node.support can be used to show posterior probablities, rates, etc.; axisChrono to add a time-scale.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# a BEAST analysis of wild barley
# -------------------------------
data(hordeum)

# plot tree invisibly to define the plotting region
# -------------------------------------------------
plot(hordeum, edge.color = 0, tip.color = 0)

# plot highest posterior density bars
# note the warning message!
# -------------------------
HPDbars(hordeum, col = "skyblue", lwd = 5)

# plot tree again with transparent background
# -------------------------------------------
plot.phylo.upon(hordeum)


# the same plot but with x.lim set to the values
# issued by the HPDbars warning message
# -------------------------------------
plot(hordeum, edge.color = 0, tip.color = 0, 
    x.lim = c(-5.24603, 23.26244))
HPDbars(hordeum, col = "skyblue", lwd = 5)
plot.phylo.upon(hordeum)

fmichonneau/phyloch documentation built on May 16, 2019, 1:45 p.m.