Learn R Programming

BMhyb (version 1.5.1)

GetAncestor: Identify the ancestor

Description

Given the descendant 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. 2016. Studying trait evolution on phylogenetic networks. Submitted.

Examples

Run this code
# NOT RUN {
	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