powered by
GetAncestor(phy, node)
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