nodeDepth | R Documentation |
Determine the depth of a particular node in a tree, defined as the number of edges between it and the root. (So the root has depth zero, its children have depth one, etc.)
nodeDepth(tree, node)
tree |
a tree of class |
node |
a number corresponding to a node in the tree. |
An integer corresponding to the depth of the given node.
Michelle Kendall michelle.louise.kendall@gmail.com
## Find the depth of node 34 in a random tree with 20 tips: tree <- rtree(20) plot(tree) nodelabels() nodeDepth(tree,34)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.