findanc {convevol}R Documentation

Find the ancestor of a given node in a phylogeny

Description

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.

Usage

findanc(phyl, node)

Arguments

phyl

The phylogeny of interest in phylo format

node

The number of the node that you want the ancestor for

Details

Returns a two-element vector. The node of the ancestor is first; the edge that connects that node with its ancestor is second.

Value

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).

References

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.

Examples


phyl<-rtree(10)
ancestor<-findanc(phyl,1)

[Package convevol version 2.2.0 Index]