getMRCAs | R Documentation |
Given a phylogeny and a data frame of species and named clades, identify the nodes that subtend those named clades.
getMRCAs(tree, clade.membership)
tree |
An ape-style phylogenetic tree |
clade.membership |
An optional data frame with first column = "species", second column = "clade". These are named, monophyletic clades to which the species in the input phylogeny can belong. Not every species in the input phylogeny needs to be in the clade membership data frame, but missing species added to species not in this frame will not be included in the output clade membership data frame. They will of course still be included in the output phylogenies. |
Given a phylogeny and a data frame of species and named clades, identify the nodes that subtend those named clades. If a clade is composed of a single species it will return the tip number of the clade
A list of named elements. Each element is a single number (a node). Names correspond to the name of the clade.
Mast et al. 2015. Paraphyly changes understanding of timing and tempo of diversification in subtribe Hakeinae (Proteaceae), a giant Australian plant radiation. American Journal of Botany.
#load a molecular tree up
data(bird.families)
#create a data frame of all taxa from the phylogeny, and make up clade memberships
#for each. note that the names on this data frame differ from "groupings" in other
#functions
dummy.frame <- data.frame(species=bird.families$tip.label,
clade=c(rep("nonPasserine", 95), rep("suboscine", 9), rep("basalOscine", 13),
rep("oscine", 20)))
#use the function
getMRCAs(bird.families, dummy.frame)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.