geom_balance: geom_balance

View source: R/geom_balance.R

geom_balanceR Documentation

geom_balance

Description

highlights the two direct descendant clades of an internal node

Usage

geom_balance(
  node,
  fill = "steelblue",
  color = "white",
  alpha = 0.5,
  extend = 0,
  extendto = NULL
)

Arguments

node

selected node (balance) to highlight its two direct descendant

fill

color to fill in the highlight rectangle, default to "steelblue"

color

color to outline highlight rectangle and divide balance, defaults to "white"

alpha

alpha (transparency) for the highlight rectangle, defaults to 0.5

extend

extend xmax of the highlight rectangle by the value of extend

extendto

extend xmax of the highlight rectangle to the value of extendto

Details

Particularly useful when studying neighboring clades. Note that balances that correspond to multichotomies will not be displayed.

Value

ggplot2

Author(s)

Justin Silverman and modified by Guangchuang Yu

References

J. Silverman, et al. A phylogenetic transform enhances analysis of compositional microbiota data. (in preparation)

For more detailed demonstration, please refer to chapter 5.2.2 of Data Integration, Manipulation and Visualization of Phylogenetic Trees http://yulab-smu.top/treedata-book/index.html by Guangchuang Yu.

Examples

library(ggtree)
set.seed(123)
tr<- rtree(15)
x <- ggtree(tr)
x + geom_balance(17)


GuangchuangYu/ggtree documentation built on Oct. 31, 2024, 10:10 a.m.