]> git.donarmstrong.com Git - ape.git/commitdiff
bug fix in write.tree()
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 7 Dec 2010 10:35:25 +0000 (10:35 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 7 Dec 2010 10:35:25 +0000 (10:35 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@141 6e262413-ae40-0410-9e79-b911bd7a66b7

ChangeLog
DESCRIPTION
R/write.tree.R
Thanks

index 3cfdf9c7eefa368bfb915d3e1beefaa83a30867c..057cf583a570dd78448d2e318059d3aaadd33e53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,9 @@ BUG FIXES
     o Objects returned by as.hclust.phylo() failed when analysed with
       cutree() or rect.hclust().
 
+    o write.tree() did not output correctly node labels (thanks to Naim
+      Matasci for the fix).
+
 
 
                CHANGES IN APE VERSION 2.6-1
index ab0adee12f90eccdbbd19bc64f54b3cc82090943..8fd651a17a72e5b67928b3b7ffabda66b6cda3ca 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.6-2
-Date: 2010-11-30
+Date: 2010-12-07
 Title: Analyses of Phylogenetics and Evolution
 Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Klaus Schliep, Korbinian Strimmer, Damien de Vienne
 Maintainer: Emmanuel Paradis <Emmanuel.Paradis@ird.fr>
index 08747b99c672a993d6ead68efd3623ea64a173ff..08de505eaf78f90db4a2000a94d7dd733b3eaa9e 100644 (file)
@@ -1,4 +1,4 @@
-## write.tree.R (2010-11-08)
+## write.tree.R (2010-12-07)
 
 ##   Write Tree File in Parenthetic Format
 
@@ -30,7 +30,7 @@ checkLabel <- function(x, ...)
 write.tree <-
     function(phy, file = "", append = FALSE, digits = 10, tree.names = FALSE)
 {
-    if (!(inherits(phy, "phylo") || inherits(phy, "multiPhylo")))
+    if (!(inherits(phy, c("phylo", "multiPhylo"))))
         stop("object \"phy\" has no trees")
 
     if (inherits(phy, "phylo")) phy <- c(phy)
@@ -73,7 +73,7 @@ write.tree <-
             if (j != desc[length(desc)]) cp(",")
         }
         cp(")")
-        if (nodelab && ind[i] > n) cp(phy$node.label[ind[i] - n])
+        if (nodelab && i > n) cp(phy$node.label[i - n]) # fixed by Naim Matasci (2010-12-07)
         if (brl) {
             cp(":")
             cp(sprintf(f.d, phy$edge.length[ind[i]]))
diff --git a/Thanks b/Thanks
index eb5ecd1ebcc02138c24a9234486aaba563d89048..aa4d19acd50e95c313b9264beb705438bf9d70fe 100644 (file)
--- a/Thanks
+++ b/Thanks
@@ -4,11 +4,11 @@ APE at one stage or another.
 Many users gave important feed-back with their encouragements,
 comments, or bug reports: thanks to all of you!
 
-Significant bug fixes were provided by Cécile Ané, James Bullard,
-Otto Cordero, Éric Durand, Olivier François, Rich FitzJohn, , Jos
-Käfer, Bret Larget, Nick Matzke, Michael Phelan, Elizabeth Purdom,
-Dan Rabosky, Filipe Vieira, Tim Wallstrom, Li-San Wang, Yan Wong,
-Peter Wragg, and Janet Young. Contact me if I forgot someone.
+Significant bug fixes were provided by Cécile Ané, James Bullard, Otto
+Cordero, Éric Durand, Olivier François, Rich FitzJohn, , Jos Käfer,
+Bret Larget, Naim Matasci, Nick Matzke, Michael Phelan, Elizabeth
+Purdom, Dan Rabosky, Filipe Vieira, Tim Wallstrom, Li-San Wang, Yan
+Wong, Peter Wragg, and Janet Young. Contact me if I forgot someone.
 
 Kurt Hornik, of the R Core Team, helped in several occasions to
 fix some problems and bugs.