ape (version 3.0-3)

subtrees: All subtrees of a Phylogenetic Tree

Description

This function returns a list of all the subtrees of a phylogenetic tree.

Usage

subtrees(tree, wait=FALSE)

Arguments

Value

subtrees returns a list of trees of class "phylo" and returns invisibly for each subtree a list with the following components:tip.labelnode.labelNtipNnode

See Also

zoom, subtreeplot for functions extracting particular subtrees.

Examples

Run this code
### Random tree with 12 leaves
phy<-rtree(12)
par(mfrow=c(4,3))
plot(phy, sub="Complete tree")

### Extract the subtrees
l<-subtrees(phy)

### plot all the subtrees
for (i in 1:11) plot(l[[i]], sub=paste("Node", l[[i]]$node.label[1]))
par(mfrow=c(1,1))

Run the code above in your browser using DataCamp Workspace