collapse.ggtree | R Documentation |
collapse a selected clade, which can later be expanded with the 'expand()' fuction if necessary
## S3 method for class 'ggtree'
collapse(x = NULL, node, mode = "none", clade_name = NULL, ...)
x |
tree view (i.e. the ggtree object). If tree_view is NULL, the last ggplot will be used. |
node |
internal node number |
mode |
one of 'none'(default), 'max', 'min' and 'mixed'. 'none' would simply collapse the clade as 'tip' and the rest will display a triangle, whose shape is determined by the farest/closest tip of the collapsed clade to indicate it |
clade_name |
set a name for the collapsed clade. If clade_name = NULL, do nothing |
... |
additional parameters to set the color or transparency of the triangle |
tree view
Guangchuang Yu
expand
x <- rtree(15)
p <- ggtree(x) + geom_tiplab()
p
p1 <- collapse(p, node = 17, mode = "mixed",
clade_name = "cclade", alpha = 0.8,
color = "grey", fill = "light blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.