subtrees: All subtrees of a Phylogenetic Tree

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

1
subtrees(tree, wait=FALSE)

Arguments

tree

an object of class "phylo".

wait

a logical indicating whether the node beeing processed should be printed (useful for big phylogenies).

Value

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

tip.label
node.label
Ntip
Nnode

Author(s)

Damien de Vienne damien.de-vienne@u-psud.fr

See Also

zoom, subtreeplot for functions extracting particular subtrees.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
### 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))

gjuggler/ape documentation built on May 17, 2019, 6:03 a.m.