From: paradis Date: Fri, 11 Feb 2011 12:54:50 +0000 (+0000) Subject: a few bug fixes especially in plot.phylo() X-Git-Url: https://git.donarmstrong.com/?p=ape.git;a=commitdiff_plain;h=d7105238f98acefc5fc0ad6278a515e682453b8b a few bug fixes especially in plot.phylo() git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@145 6e262413-ae40-0410-9e79-b911bd7a66b7 --- diff --git a/ChangeLog b/ChangeLog index a4985e5..8480ce8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,11 +17,18 @@ BUG FIXES o read.dna(, "fasta") failed if sequences were not all of the same length. + o plot.phylo() did not recycle values of 'font', 'cex' and + 'tip.color' correctly when type = "fan" or "radial". + OTHER CHANGES o In drop.fossil() the default tol = 0 has been raised to 1e-8. + o The help command ?phylo now points to the man page of read.tree() + where this class is described. Similarly, ?matching points to the + man page of as.matching(). + CHANGES IN APE VERSION 2.6-2 diff --git a/DESCRIPTION b/DESCRIPTION index c3f4954..17dfadf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ape Version: 2.6-3 -Date: 2011-02-01 +Date: 2011-02-11 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/plot.phylo.R b/R/plot.phylo.R index df246bd..69f0866 100644 --- a/R/plot.phylo.R +++ b/R/plot.phylo.R @@ -1,8 +1,8 @@ -## plot.phylo.R (2010-08-12) +## plot.phylo.R (2011-02-11) ## Plot Phylogenies -## Copyright 2002-2010 Emmanuel Paradis +## Copyright 2002-2011 Emmanuel Paradis ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. @@ -359,9 +359,13 @@ plot.phylo <- function(x, type = "phylogram", use.edge.length = TRUE, srt <- 180*XY$axe/pi srt[as.logical(adj)] <- srt[as.logical(adj)] - 180 ## `srt' takes only a single value, so can't vectorize this: + ## (and need to 'elongate' these vectors:) + font <- rep(font, length.out = Ntip) + tip.color <- rep(tip.color, length.out = Ntip) + cex <- rep(cex, length.out = Ntip) for (i in 1:Ntip) - text(xx[i], yy[i], cex = cex, x$tip.label[i], adj = adj[i], - font = font, srt = srt[i], col = tip.color[i]) + text(xx[i], yy[i], cex = cex[i], x$tip.label[i], adj = adj[i], + font = font[i], srt = srt[i], col = tip.color[i]) } } if (type %in% c("fan", "radial")) { @@ -373,8 +377,12 @@ plot.phylo <- function(x, type = "phylogram", use.edge.length = TRUE, adj <- numeric(Ntip) adj[xx.tips < 0] <- 1 ## `srt' takes only a single value, so can't vectorize this: + ## (and need to 'elongate' these vectors:) + font <- rep(font, length.out = Ntip) + tip.color <- rep(tip.color, length.out = Ntip) + cex <- rep(cex, length.out = Ntip) for (i in 1:Ntip) - text(xx[i], yy[i], x$tip.label[i], font = font, cex = cex, + text(xx[i], yy[i], x$tip.label[i], font = font[i], cex = cex[i], srt = angle[i], adj = adj[i], col = tip.color[i]) } } diff --git a/man/as.matching.Rd b/man/as.matching.Rd index 8a156c6..ece8f32 100644 --- a/man/as.matching.Rd +++ b/man/as.matching.Rd @@ -1,5 +1,6 @@ \name{as.matching} \alias{as.matching} +\alias{matching} \alias{as.matching.phylo} \alias{as.phylo.matching} \title{Conversion Between Phylo and Matching Objects} diff --git a/man/read.tree.Rd b/man/read.tree.Rd index 1bf915c..5e31c55 100644 --- a/man/read.tree.Rd +++ b/man/read.tree.Rd @@ -1,5 +1,6 @@ \name{read.tree} \alias{read.tree} +\alias{phylo} \title{Read Tree File in Parenthetic Format} \usage{ read.tree(file = "", text = NULL, tree.names = NULL, skip = 0,