View source: R/identifyMissing.R
identifyMissing | R Documentation |
Given a data frame of species and taxonomic assignments, and an accepted phylogeny with some of those species in it, identify which species are not included in the phylogeny.
identifyMissing(tree, groupings)
tree |
An ape-style phylogenetic tree |
groupings |
A data frame with two columns, "species" and "group". Missing species, to be added, are taken as those that do not match a value in the tip labels of tree. |
Utility function to identify taxa in the groupings data frame that are not included in the input phylogeny.
A data frame of missing taxa with two columns, species and group.
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.
data(chelonia)
tree <- chelonia$phy
#some species in this tree are identified to subspecies. drop those
temp <- lapply(strsplit(tree$tip.label, "_"), length)
names(temp) <- tree$tip.label
temp <- temp[temp==2]
tree <- drop.tip(tree, setdiff(tree$tip.label, names(temp)))
#create an example groupings data frame.
groupsDF <- data.frame(species=tree$tip.label)
groupsDF$group <- unlist(lapply(strsplit(tree$tip.label, "_"), "[", 1))
#use the function to drop 100 species (that is over half the species)
example <- tipDropper(tree, groupsDF, 100)
#identify missing species
identifyMissing(example, groupsDF)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.