1 ## subtrees.R (2008-04-14)
3 ## All subtrees of a Phylogenetic Tree
5 ## Copyright 2008 Damien de Vienne
7 ## This file is part of the R-package `ape'.
8 ## See the file ../COPYING for licensing issues.
10 subtrees<-function(tree, wait = FALSE)
18 for (k in (N.tip+1):limit)
21 if (wait==TRUE) cat("wait... Node",u,"out of", N.node, "treated\n")
26 for (i in 1: length(pere)) fils<-c(fils, tree$edge[,2][tree$edge[,1]==pere[i]])
30 if (length(pere)==0) break
39 len.tip<-res[res<N.tip+1]
40 vec<-1:length(tree$tip.label)
41 len.tip.stay<-setdiff(vec, len.tip)
42 tree2<-drop.tip(tree, len.tip.stay)
46 #sub[[u]]$name<-tree2$node.label[1]
47 sub[[u]]$Ntip<-Ntip(tree2)
48 sub[[u]]$Nnode<-Nnode(tree2)
49 if (is.null(tree$node.label))
50 sub[[u]]$node.label<-len