Learn R Programming

BMhyd (version 1.2-8)

GetAncestor: Identify the ancestor

Description

Given the descedent node for the tree, the function will return its ancestor node.

Usage

GetAncestor(phy, node)

Arguments

phy
an object of class 'phylo'.
node
descedant node.

Value

the ancestor node

References

Jhwueng D.C. and O'Meara B.C. 2015. Studying trait evolution in hybrid species on phylogenetic networks. Submitted.

Examples

Run this code
	library(ape)
	#simulate a tree of 3 taxa
 	phy<-rtree(3)
 	#plot the tree
 	plot(phy) 
 	#descedant node
 	node<-1
 	#get the ancestor node, it will return 5.
 	GetAncestor(phy,node) 
 	

Run the code above in your browser using DataLab