Find the ancestor of a given node in a phylogeny
This function will find the ancestor of a given node in a phylogeny. It will return a two-element vector, which will contain both the node of the ancestor and the number of the edge that connects the node and ancestor.
findanc(phyl, node)
phyl |
The phylogeny of interest in phylo format |
node |
The number of the node that you want the ancestor for |
Returns a two-element vector. The node of the ancestor is first; the edge that connects that node with its ancestor is second.
A two-element vector, where the first element is the node of the ancestor and the second element is the number of the edge that connects the node and ancestor (i.e., the row number in phyl$edge).
Paradis, E., J. Claude, and K. Strimmer (2004) APE: Analyses of phylogenetics and evolution in R langauge. Bioinformatics, 20, 289-290. Paradis, E. (2012) Analysis of Phylogenetics and Evolution with R (Second Edition). New York: Springer.
phyl<-rtree(10) ancestor<-findanc(phyl,1)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.