Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

findanc

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)

convevol

Analysis of Convergent Evolution

v1.3
GPL-2
Authors
C. Tristan Stayton [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.