]> git.donarmstrong.com Git - ape.git/blob - man/subtrees.Rd
new files by Damien + a few bug fixes
[ape.git] / man / subtrees.Rd
1 \name{subtrees}
2 \alias{subtrees}
3 \title{All subtrees of a Phylogenetic Tree}
4 \usage{
5 subtrees(x, wait=FALSE)
6 }
7 \arguments{
8   \item{x}{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 \see also{
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 returns invisibly for each subtree a list with the following
20   components:
21
22   \item{tip.label}
23   \item{node.label}
24   \item{Ntip}
25   \item{Nnode}
26 }
27 \examples{
28 ### Random tree with 12 leaves
29 phy<-rtree(12)
30 par(mfrow=c(4,3))
31 plot(phy, sub="Complete tree")
32
33 ### Extract the subtrees
34 l<-subtrees(phy)
35
36 ### plot all the subtrees
37 for (i in 1:11) plot(l[[i]], sub=paste("Node", l[[i]]$node.label[1]))
38 par(mfrow=c(1,1))
39 }