Learn R Programming

BMhyd (version 1.2-8)

GetClade: Get clade from the tree

Description

Search and report the nodes of the tree that have the desired clade size.

Usage

GetClade(phy, clade.size)

Arguments

phy
an object of class 'phylo'.
clade.size
size of the clade.

Value

the interior node that has descedants of size clade.size on the tip.

Details

This function uses the 'phylo' class where the edges(ancestor-decedant relationship) of the tree are used to identify the interior node with desired number of descedent (clade.size) on the tips. It applies the function findMRCA in phytools to search the ancestor.

References

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

Examples

Run this code
	library(ape)
	library(phytools)
	#simulate a tree 
 	phy<-rtree(3)
 	#plot the tree
 	plot(phy) 
 	#set up the clade size
 	clade.size<-2
 	#search the nodes that has desired clade size
 	GetClade(phy,clade.size) #node 5 will be return
 	

Run the code above in your browser using DataLab