Description Usage Arguments Details Value Author(s) See Also Examples
Reports the ancestors of a given node. Now simply a wrapper for TreeTools::ListAncestors()
.
1 | list.ancestors(parent, child, node)
|
parent |
the 'parent' column of the edges property of a tree of class |
child |
the 'child' column of the edges property of a tree of class |
node |
the number of the node or tip whose ancestors are required. |
To observe the number of a node or tip, use
plot(tree); nodelabels(); tiplabels();
Returns a vector of the numbers of the nodes ancestral to the given node
, including the root node.
Martin R. Smith
phangorn:::Ancestors
, a less efficient implementation on which this code is based.
1 2 3 4 5 | tree <- ape::read.tree(text='(1, (2, (3, (4, 5))));')
edge <- tree$edge
parent <- tree$edge[, 1]
child <- tree$edge[, 2]
list.ancestors(parent, child, 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.