From 2014b83971be4b9cd1644d6127837df798e9335c Mon Sep 17 00:00:00 2001 From: paradis Date: Mon, 22 Oct 2012 10:13:38 +0000 Subject: [PATCH] final corrections for ape 3.0-6 git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@198 6e262413-ae40-0410-9e79-b911bd7a66b7 --- DESCRIPTION | 2 +- NEWS | 14 ++++++++++---- R/drop.tip.R | 3 ++- R/plot.phylo.R | 8 ++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 32f124c..3904cc8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ape Version: 3.0-6 -Date: 2012-10-12 +Date: 2012-10-20 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, Andrei-Alin Popescu, Klaus Schliep, Korbinian Strimmer, Damien de Vienne Maintainer: Emmanuel Paradis diff --git a/NEWS b/NEWS index 6ba9bc4..e90cec1 100644 --- a/NEWS +++ b/NEWS @@ -9,8 +9,7 @@ NEW FEATURES o The three new functions node.depth.edgelength, node.height, and node.height.clado make some internal code available from R. See - ?node.depth (which was already available and documented) for - details. + ?node.depth (which was already documented) for details. BUG FIXES @@ -18,8 +17,15 @@ BUG FIXES o reorder(, "pruningwise") made R crash if the rows of the edge matrix are in random order: this is now fixed. - o drop.tip() sometimes shuffled node labels (thanks to Rebecca Best - for the report). + o drop.tip() sometimes shuffled node labels (thanks to Rebecca + Best for the report). + + o drop.tip(phy, "") returned a tree with zero-length tip labels: + it now returns the tree unchanged (thanks to Brian Anacker for + the report). + + o plot.phylo() made R crash if the tree has zero-length tip + labels: it now returns NULL (thanks again to Brian Anacker). OTHER CHANGES diff --git a/R/drop.tip.R b/R/drop.tip.R index e9bd5c0..a720a7c 100644 --- a/R/drop.tip.R +++ b/R/drop.tip.R @@ -1,4 +1,4 @@ -## drop.tip.R (2012-10-06) +## drop.tip.R (2012-10-20) ## Remove Tips in a Phylogenetic Tree @@ -101,6 +101,7 @@ drop.tip <- if (is.character(tip)) tip <- which(phy$tip.label %in% tip) } + if (!length(tip)) return(phy) if (any(tip > Ntip)) warning("some tip numbers were higher than the number of tips") diff --git a/R/plot.phylo.R b/R/plot.phylo.R index 862291d..4c23c6f 100644 --- a/R/plot.phylo.R +++ b/R/plot.phylo.R @@ -1,4 +1,4 @@ -## plot.phylo.R (2012-10-02) +## plot.phylo.R (2012-10-20) ## Plot Phylogenies @@ -18,8 +18,8 @@ plot.phylo <- tip.color = "black", plot = TRUE, rotate.tree = 0, ...) { Ntip <- length(x$tip.label) - if (Ntip == 1) { - warning("found only one tip in the tree") + if (Ntip < 2) { + warning("found less than 2 tips in the tree") return(NULL) } if (any(tabulate(x$edge[, 1]) == 1)) @@ -421,7 +421,7 @@ phylogram.plot <- function(edge, Ntip, Nnode, xx, yy, horizontal, yy <- xx xx <- tmp } - ## un trait vertical à chaque noeud... + ## un trait vertical a chaque noeud... x0v <- xx[nodes] y0v <- y1v <- numeric(Nnode) ## store the index of each node in the 1st column of edge: -- 2.39.2