]> git.donarmstrong.com Git - ape.git/commitdiff
correcting bug in drop.tip
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Wed, 4 Mar 2009 08:38:20 +0000 (08:38 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Wed, 4 Mar 2009 08:38:20 +0000 (08:38 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@64 6e262413-ae40-0410-9e79-b911bd7a66b7

ChangeLog
DESCRIPTION
R/drop.tip.R
man/plot.phylo.Rd

index 2d14a5ba3a3332a55185379fde7d3eaf19533bc7..c01a581e240f14e700a6861d148af85c0bf8305f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,11 @@ NEW FEATURES
       Yule model by maximum likelihood.
 
 
+BUG FIXES
+
+    o drop.tip() shuffled tip labels in some cases.
+
+
 
                CHANGES IN APE VERSION 2.2-4
 
index e013e3f4742e1a9987b44e0d489931341564ec72..65f9a433d4bff9eb05687f9ebc704409f7fa8310 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.3
-Date: 2009-02-20
+Date: 2009-03-04
 Title: Analyses of Phylogenetics and Evolution
 Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong,
   Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel,
index d819c757ce1c845d5165a555b9063668f5460962..69c957629e6533598488d0f7b3c4ede773faede7 100644 (file)
@@ -1,4 +1,4 @@
-## drop.tip.R (2009-01-07)
+## drop.tip.R (2009-03-04)
 
 ##   Remove Tips in a Phylogenetic Tree
 
@@ -22,7 +22,8 @@ extract.clade <- function(phy, node, root.edge = 0)
             stop("the tree has no node labels")
         node <- which(phy$node.label %in% node) + Ntip
     }
-    if (node <= Ntip) stop("node number must be greater than the number of tips")
+    if (node <= Ntip)
+        stop("node number must be greater than the number of tips")
     if (node == ROOT) return(phy)
     phy <- reorder(phy) # insure it is in cladewise order
     root.node <- which(phy$edge[, 2] == node)
@@ -143,7 +144,7 @@ drop.tip <-
     ## 2) renumber the remaining tips now
     TIPS <- phy$edge[, 2] <= Ntip
     ## keep the ordering so no need to reorder tip.label:
-    phy$edge[TIPS, 2] <- order(phy$edge[TIPS, 2])
+    phy$edge[TIPS, 2] <- rank(phy$edge[TIPS, 2])
     Ntip <- length(phy$tip.label) # update Ntip
 
     ## make new tip labels if necessary
@@ -176,6 +177,6 @@ drop.tip <-
     phy$edge[sndcol, 2] <- newNb[phy$edge[sndcol, 2]] <-
         (Ntip + 2):(Ntip + phy$Nnode)
     phy$edge[, 1] <- newNb[phy$edge[, 1]]
-
+    storage.mode(phy$edge) <- "integer"
     collapse.singles(phy)
 }
index b9622effade18c75f51e094c2e97b44eb4bc8586..dcabb28e6abdc8e90bdbf0c5fc1117e4c3481376 100644 (file)
@@ -184,16 +184,6 @@ plot(tree.owls, type = "c", use.edge.length = FALSE)
 plot(tree.owls, type = "u", use.edge.length = FALSE)
 layout(matrix(1))
 
-data(xenarthra)
-plot(xenarthra)
-### remove the margins...
-plot(xenarthra, no.margin = TRUE)
-### ... and use a smaller font size
-plot(xenarthra, no.margin = TRUE, cex = 0.8)
-plot(xenarthra, type = "c", no.margin = TRUE,
-     use.edge.length = FALSE, cex = 0.8)
-par(mar = c(5.1, 4.1, 4.1, 2.1))
-
 data(bird.orders)
 ### using random colours and thickness
 plot(bird.orders,