]> git.donarmstrong.com Git - ape.git/blobdiff - R/drop.tip.R
improvements to compar.gee + bug fix in extract.clade
[ape.git] / R / drop.tip.R
index e59b59b957a06ebf2a350b5d68d10741e3e3fbc4..c5eb07c45c728d381830ff3761c165c4f9e329be 100644 (file)
@@ -1,4 +1,4 @@
-## drop.tip.R (2010-02-11)
+## drop.tip.R (2010-07-21)
 
 ##   Remove Tips in a Phylogenetic Tree
 
@@ -54,7 +54,7 @@ extract.clade <- function(phy, node, root.edge = 0, interactive = FALSE)
     if (wbl) phy$edge.length <- phy$edge.length[keep]
     TIPS <- phy$edge[, 2] <= Ntip
     tip <- phy$edge[TIPS, 2]
-    phy$tip.label <- phy$tip.label[tip]
+    phy$tip.label <- phy$tip.label[sort(tip)] # <- added sort to avoid shuffling of tip labels (2010-07-21)
     ## keep the ordering so no need to reorder tip.label:
     phy$edge[TIPS, 2] <- order(tip)
     if (!is.null(phy$node.label))