annotate_balance | R Documentation |
annotate a balance oriented with respect to the PhILR transform.
That is, you can specify labels for the numerator (up
) and
denominator (down
).
annotate_balance(
tr,
coord,
p = NULL,
labels = c("+", "-"),
offset = 0,
offset.text = 0.03,
bar = TRUE,
barsize = 0.01,
barfill = "darkgrey",
geom = "text",
...
)
tr |
phylo object |
coord |
named internal node/balance to annotate |
p |
ggtree plot (tree layer), if |
labels |
label for the numerator and denominator of the balance respectively |
offset |
offset for bar (if |
offset.text |
offset of text from bar (if |
bar |
logical, should bar for each clade be plotted |
barsize |
width of bar (if |
barfill |
fill of bar |
geom |
geom used to draw label (e.g., |
... |
additional parameters passed to |
ggplot object
Justin Silverman
Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution 2016, doi:10.1111/2041-210X.12628
tr <- named_rtree(10)
annotate_balance(tr, 'n4', size=7)
annotate_balance(tr, 'n4', size=7, barsize=0.04, barfill='darkgreen',
offset.text=0.05, color='red')
annotate_balance(tr, 'n4', bar=FALSE, size=7)
annotate_balance(tr, 'n4', bar=TRUE, size=7, labels=c('Num', 'Denom'),
offset.text=.3)
annotate_balance(tr, 'n4', bar=TRUE, geom='label', size=8, offset.text=0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.