Description Usage Arguments Details Value See Also Examples
View source: R/plot.phylo.HPD.R
This function plots a phylo
BEAST tree read by
read.annot.beast
with its 95
intervals and adds a x-axis scale.
1 2 3 |
x |
annotated |
nodes |
a vector with node numbers to
plot. Default is |
pb |
TRUE if the tree is a chronogram from PhyloBayes with HPD |
bar.width |
fraction of 1 for bar thickness |
bar.col |
bar color |
border |
if bar borders should be drawn. See ?rect. |
vline |
add a vertical lines (default: TRUE) |
... |
further arguments passed by |
** Now includes support for PhyloBayes chronograms **
plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | file <- system.file("data/mcc.tre", package="rBt")
tr <- read.annot.beast(file)
# plot HPD heights on all nodes:
plot.phylo.HPD(tr, cex=0.5, bar.width=0.4, bar.col="red", border=NA)
# with library(scales) for transparency
# plot.phylo.HPD(tr, cex=0.5, bar.width=0.4, bar.col=alpha("red",0.5), border=NA)
# plot HPD heights on specific nodes:
tips <- tr$tip.label
tipsfac <- factor(sapply(tips, function(x) strsplit(x, "__")[[1]][1] ))
names(tipsfac) <- NULL
tipslist <- split(tips, tipsfac)
allanc <- c(unlist(sapply(tipslist, function(x, y=tr) Ancestors(tr, which.node(y, x)) )),
sapply(tipslist, function(x) which.node(tr, x)))
allanc <- sort(allanc)
allanc <- allanc[ !duplicated(allanc) ]
names(allanc) <- NULL
plot.phylo.HPD(tr, cex=0.5, bar.width=0.4, bar.col="red", border=NA, nodes=allanc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.