Learn R Programming

windex (version 2.1.0)

prune2data: Prunes a phylogenetic tree to match a vector (e.g. of species names in a dataset)

Description

Takes a phylo object and vector of names to be matched to tip labels and returns a pruned phylogeny containing only tip labels that match those in the vector.

Usage

prune2data(tree, species)

Value

Returns a phylogenetic tree of the class 'phylo' containing only tips whose labels match the input vector (species)

Arguments

tree

Phylogenetic tree of class 'phylo'.

species

Vector of names to be matched against tip labels of the tree.

Author

Kevin Arbuckle

Examples

Run this code
data(sample.data)
data(sample.tree)
tree<-prune2data(sample.tree,sample.data$species[1:10])
plot(tree)

Run the code above in your browser using DataLab