Package: ape
Version: 2.7-2
-Date: 2011-05-19
+Date: 2011-06-01
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>
o plot.phylo() has a new option 'draw = TRUE'. If FALSE, the tree
is not plotted but the graphical device is set and the
- coordinates are saved as normal.
+ coordinates are saved as usual.
o diversity.contrast.test() gains a fourth version of the test with
method = "logratio"; the literature citations have been clarified.
+ o add.scale.bar() has two new options, 'lwd' and 'lcol', to modify
+ the aspect of the bar.
+
BUG FIXES
- o bionj() made R crash if distances were two large. It now returns
+ o bionj() made R crash if distances were too large. It now returns
an error if at least one distance is greater than 100.
o drop.tip() returned a wrong tree if 'tip' was of zero length.
+ o read.nexus.data() failed with URLs.
+
CHANGES IN APE VERSION 2.7-1
{
# Simplified NEXUS data parser.
#
- # Version: 09/13/2006 01:01:59 PM CEST
+ # Version: 09/13/2006 01:01:59 PM CEST
+ # (modified by EP 2011-06-01)
#
# By: Johan Nylander, nylander @ scs.fsu.edu
#
}
"trim.whitespace" <- function (x)
- {
+ {
gsub("\\s+", "", x)
}
gsub(";", "", x)
}
- if(file.access(file, mode = 4)) {
- stop("file could not be found")
- }
-
X <- scan(file = file, what = character(), sep = "\n",
quiet = TRUE, comment.char = "[", strip.white = TRUE)
ntax <- find.ntax(X)
tot.ntax <- tot.ntax + 1
if (tot.ntax == ntax) {
i <- 1
- tot.ntax <- 0
+ tot.ntax <- 0
tot.nchar <- tot.nchar + chars.done
if (tot.nchar == nchar*ntax) {
print("ntot was more than nchar*ntax")
-## scales.R (2009-12-16)
+## scales.R (2011-05-31)
## Add a Scale Bar or Axis to a Phylogeny Plot
## add.scale.bar: add a scale bar to a phylogeny plot
## axisPhylo: add a scale axis on the side of a phylogeny plot
-## Copyright 2002-2009 Emmanuel Paradis
+## Copyright 2002-2011 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
-add.scale.bar <- function(x, y, length = NULL, ask = FALSE, ...)
+add.scale.bar <- function(x, y, length = NULL, ask = FALSE,
+ lwd = 1, lcol = "black", ...)
{
lastPP <- get("last_plot.phylo", envir = .PlotPhyloEnv)
direc <- lastPP$direction
switch(direc,
"rightwards" = {
- segments(x, y, x + length, y)
+ segments(x, y, x + length, y, col = lcol, lwd = lwd)
text(x + length * 1.1, y, as.character(length), adj = c(0, 0.5), ...)
},
"leftwards" = {
- segments(x - length, y, x, y)
+ segments(x - length, y, x, y, col = lcol, lwd = lwd)
text(x - length * 1.1, y, as.character(length), adj = c(1, 0.5), ...)
},
"upwards" = {
- segments(x, y, x, y + length)
+ segments(x, y, x, y + length, col = lcol, lwd = lwd)
text(x, y + length * 1.1, as.character(length), adj = c(0, 0.5), srt = 90, ...)
},
"downwards" = {
- segments(x, y - length, x, y)
+ segments(x, y - length, x, y, col = lcol, lwd = lwd)
text(x, y - length * 1.1, as.character(length), adj = c(0, 0.5), srt = 270, ...)
})
}
\alias{add.scale.bar}
\title{Add a Scale Bar to a Phylogeny Plot}
\usage{
-add.scale.bar(x, y, length = NULL, ask = FALSE, ...)
+add.scale.bar(x, y, length = NULL, ask = FALSE,
+ lwd = 1, lcol = "black", ...)
}
\arguments{
\item{x}{x location of the bar (can be left missing).}
none is supplied, a value is calculated from the data.}
\item{ask}{a logical; if \code{TRUE} the user is asked to click where
to draw the bar. The default is \code{FALSE}.}
+ \item{lwd}{the width of the bar.}
+ \item{lcol}{the colour of the bar (use \code{col} for the colour of
+ the text).}
\item{\dots}{further arguments to be passed to \code{text}.}
}
\description{