From 081bbd65bc9bbf19658c1dfc0724d17bf925626e Mon Sep 17 00:00:00 2001 From: paradis Date: Tue, 7 Dec 2010 10:35:25 +0000 Subject: [PATCH] bug fix in write.tree() git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@141 6e262413-ae40-0410-9e79-b911bd7a66b7 --- ChangeLog | 3 +++ DESCRIPTION | 2 +- R/write.tree.R | 6 +++--- Thanks | 10 +++++----- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3cfdf9c..057cf58 100644 --- 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 diff --git a/DESCRIPTION b/DESCRIPTION index ab0adee..8fd651a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 diff --git a/R/write.tree.R b/R/write.tree.R index 08747b9..08de505 100644 --- a/R/write.tree.R +++ b/R/write.tree.R @@ -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 eb5ecd1..aa4d19a 100644 --- 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. -- 2.39.2