]> git.donarmstrong.com Git - ape.git/commitdiff
various fixes and small news
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Fri, 3 Jun 2011 04:08:54 +0000 (04:08 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Fri, 3 Jun 2011 04:08:54 +0000 (04:08 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@159 6e262413-ae40-0410-9e79-b911bd7a66b7

DESCRIPTION
NEWS
R/read.nexus.data.R
R/scales.R
man/add.scale.bar.Rd

index 4005e70454ed2f926c0ed4064b616f81966c89c2..5ac5ac717cb5ff9774a5df8a97c8901152e4edc3 100644 (file)
@@ -1,6 +1,6 @@
 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>
diff --git a/NEWS b/NEWS
index f9af94942c616c89d85011a2975df7e8bb322552..f80ec46d3747d4324a65594c83a0a90007da4800 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,19 +5,24 @@ NEW FEATURES
 
     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
index 076173c3de32206c567ea1d974326afcd8650955..cd261a40ab6d7463177fffca40a18526b03b51af 100644 (file)
@@ -2,7 +2,8 @@
 {
     # 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
     #
@@ -53,7 +54,7 @@
     }
 
     "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")
index 2243278b19e8b94c9c6b6e652c32687eb39f9a92..7176d1f5c6e19b1ab60ec11ff2633eb1725ec097 100644 (file)
@@ -1,16 +1,17 @@
-## 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
@@ -55,19 +56,19 @@ add.scale.bar <- function(x, y, length = NULL, ask = FALSE, ...)
 
     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, ...)
            })
 }
index ecef307ea0274a167bb8f74eede9fad2297c580b..3f1ee59c75332f99f3dbb567113e51db73735581 100644 (file)
@@ -2,7 +2,8 @@
 \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).}
@@ -11,6 +12,9 @@ add.scale.bar(x, y, length = NULL, ask = FALSE, ...)
     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{