distNode: Calculate the distance between any two nodes on the tree

Description Usage Arguments Value Examples

View source: R/tree_distNode.R

Description

distNode is to calculate the distance between any two nodes on a phylo tree

Usage

1
distNode(tree, node)

Arguments

tree

A phylo object.

node

A numeric or character vector of length two.

Value

A numeric value.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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))

fionarhuang/TreeSummarizedExperiment documentation built on Aug. 18, 2021, 12:15 p.m.