View source: R/clade-functions.R
flip | R Documentation |
exchange the position of 2 clades
flip(tree_view = NULL, node1, node2)
tree_view |
tree view (i.e. the ggtree object). If tree_view is NULL, the last ggplot will be used. |
node1 |
node number of clade 1. It should share a same parent node with node2 |
node2 |
node number of clade 2. It should share a same parent node with node1 |
ggplot object
Guangchuang Yu
set.seed(123)
x <- rtree(15)
p <- ggtree(x) + geom_tiplab() +
geom_nodelab(aes(subset=!isTip, label=node), hjust = -.1, color = "red")
flip(p, 23, 24) ## Depends on the condition of your tree
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.