From 0d199dba8a3608f86e89673cc4623755a3ff5a72 Mon Sep 17 00:00:00 2001 From: paradis Date: Mon, 27 Apr 2009 07:00:32 +0000 Subject: [PATCH] fixed a small bug in read.tree git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@71 6e262413-ae40-0410-9e79-b911bd7a66b7 --- ChangeLog | 2 ++ DESCRIPTION | 2 +- R/read.nexus.R | 5 +++-- R/read.tree.R | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a9c02b..c154531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ BUG FIXES o dist.gene() failed on most occasions with the default pairwise.deletion = FALSE. + o read.tree() failed to read correctly the tree name(s). + CHANGES IN APE VERSION 2.3 diff --git a/DESCRIPTION b/DESCRIPTION index e89a11b..9bd41dc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ape Version: 2.3-1 -Date: 2009-04-31 +Date: 2009-04-27 Title: Analyses of Phylogenetics and Evolution Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Gangolf Jobb, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Korbinian Strimmer, Damien de Vienne Maintainer: Emmanuel Paradis diff --git a/R/read.nexus.R b/R/read.nexus.R index b8a17d8..3edcd3f 100644 --- a/R/read.nexus.R +++ b/R/read.nexus.R @@ -1,4 +1,4 @@ -## read.nexus.R (2009-01-19) +## read.nexus.R (2009-04-01) ## Read Tree File in Nexus Format @@ -228,7 +228,8 @@ read.nexus <- function(file, tree.names = NULL) class(trees) <- "multiPhylo" } if (length(grep("[\\/]", file)) == 1) - file <- paste(getwd(), file, sep = "/") + if (!file.exists(file)) # suggestion by Francois Michonneau + file <- paste(getwd(), file, sep = "/") attr(trees, "origin") <- file trees } diff --git a/R/read.tree.R b/R/read.tree.R index aa0b029..d19acae 100644 --- a/R/read.tree.R +++ b/R/read.tree.R @@ -1,4 +1,4 @@ -## read.tree.R (2009-03-29) +## read.tree.R (2009-04-27) ## Read Tree Files in Parenthetic Format @@ -133,7 +133,7 @@ read.tree <- function(file = "", text = NULL, tree.names = NULL, skip = 0, tmp <- unlist(lapply(STRING, unname)) tmpnames <- tmp[c(TRUE, FALSE)] - tree <- tmp[c(FALSE, TRUE)] + STRING <- tmp[c(FALSE, TRUE)] if (is.null(tree.names) && any(nzchar(tmpnames))) tree.names <- tmpnames -- 2.39.2