distNode {TreeSummarizedExperiment} | R Documentation |
distNode
is to calculate the distance between any two nodes on
a phylo
tree
distNode(tree, node)
tree |
A phylo object. |
node |
A numeric or character vector of length two. |
A numeric value.
library(ggtree) data(tinyTree) ggtree(tinyTree) + geom_text2(aes(label = node), color = "darkorange", hjust = -0.1, vjust = -0.7) + geom_text2(aes(label = branch.length), color = "darkblue", vjust = 0.7) distNode(tree = tinyTree, node = c(10, 11)) distNode(tree = tinyTree, node = c(12, 13)) distNode(tree = tinyTree, node = c(13, 15)) distNode(tree = tinyTree, node = c(12, 14))