]> git.donarmstrong.com Git - ape.git/blob - man/subtrees.Rd
small changed in add.scale.bar
[ape.git] / man / subtrees.Rd
1 \name{subtrees}
2 \alias{subtrees}
3 \title{All subtrees of a Phylogenetic Tree}
4 \usage{
5 subtrees(tree, wait=FALSE)
6 }
7 \arguments{
8   \item{tree}{an object of class \code{"phylo"}.}
9   \item{wait}{a logical indicating whether the node beeing processed should be printed (useful for big phylogenies).}
10 }
11 \description{
12   This function returns a list of all the subtrees of a phylogenetic tree.
13 }
14 \author{Damien de Vienne \email{damien.de-vienne@u-psud.fr}}
15 \seealso{
16   \code{\link{zoom}}, \code{\link{subtreeplot}} for functions extracting particular subtrees.
17 }
18 \value{
19   \code{subtrees} returns a list of trees of class \code{"phylo"} and
20   returns invisibly for each subtree a list with the following
21   components:
22
23   \item{tip.label}{}
24   \item{node.label}{}
25   \item{Ntip}{}
26   \item{Nnode}{}
27 }
28 \examples{
29 ### Random tree with 12 leaves
30 phy<-rtree(12)
31 par(mfrow=c(4,3))
32 plot(phy, sub="Complete tree")
33
34 ### Extract the subtrees
35 l<-subtrees(phy)
36
37 ### plot all the subtrees
38 for (i in 1:11) plot(l[[i]], sub=paste("Node", l[[i]]$node.label[1]))
39 par(mfrow=c(1,1))
40 }
41 \keyword{manip}