]> git.donarmstrong.com Git - ape.git/commitdiff
fixing a few bugs...
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Wed, 27 Feb 2008 16:07:52 +0000 (16:07 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Wed, 27 Feb 2008 16:07:52 +0000 (16:07 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@19 6e262413-ae40-0410-9e79-b911bd7a66b7

Changes
DESCRIPTION
R/compar.gee.R
R/dist.topo.R
R/ltt.plot.R
R/nodelabels.R
man/ltt.plot.Rd

diff --git a/Changes b/Changes
index ae08426ccfaa98d289c9fc3642a76748eb501eb1..c488bf76b8cb1410cf2b74500298125f9fa4c1a4 100644 (file)
--- a/Changes
+++ b/Changes
@@ -6,6 +6,25 @@ NEW FEATURES
     o root() gains the options 'node' and 'resolve.root'
       (FALSE by default) as well as its code being improved.
 
+    o mltt.plot() has now an option 'log' used in the same way
+      than in plot.default()
+
+
+BUG FIXES
+
+    o mltt.plot() failed to display the legend with an unnamed
+      list of trees.
+
+    o nodelabels() with pies now correcly uses the argument
+      'cex' to draw symbols of different sizes (which has
+      worked already for thermometers).
+
+
+OTHER CHANGES
+
+    o The argument 'family' of compar.gee() can now be a function
+      as well as a character string.
+
 
 
                CHANGES IN APE VERSION 2.1-1
index d6759e9e0f5dfe95e895677a309158aa4ca216ff..f7c1c7ae3cad9795d584596d9ca5f0146b736d4c 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.1-2
-Date: 2008-02-11
+Date: 2008-02-21
 Title: Analyses of Phylogenetics and Evolution
 Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong,
   Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel,
index f8a7b6ae43e217c51b79e8e79890f19021141358..9c52460198409835b7aea9042664b3132d2048b7 100644 (file)
@@ -1,4 +1,4 @@
-## compar.gee.R (2008-01-14)
+## compar.gee.R (2008-02-21)
 
 ##   Comparative Analysis with GEEs
 
@@ -30,7 +30,9 @@ do not match: the former were ignored in the analysis.")
                                   corstr = "fixed", scale.fix = scale.fix,
                                   scale.value = scale.value))
     W <- geemod$naive.variance
-    if (family == "binomial")
+    fname <-
+        if is.function(family) deparse(substitute(family)) else family
+    if (fname == "binomial")
       W <- summary(glm(formula, family = quasibinomial, data = data))$cov.scaled
     N <- geemod$nobs
     dfP <- sum(phy$edge.length)*N / sum(diag(vcv.phylo(phy)))
index f6784a9ab58db123feead3f4bd3da31f103d12ee..04313b43a0a8ae0ad9f37e1e3bc6e8a85ad977d9 100644 (file)
@@ -1,9 +1,9 @@
-## dist.topo.R (2007-07-04)
+## dist.topo.R (2008-02-27)
 
 ##      Topological Distances, Tree Bipartitions,
 ##   Consensus Trees, and Bootstrapping Phylogenies
 
-## Copyright 2005-2007 Emmanuel Paradis
+## Copyright 2005-2008 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -165,12 +165,15 @@ prop.clades <- function(phy, ..., part = NULL)
 boot.phylo <- function(phy, x, FUN, B = 100, block = 1)
 {
     if (is.list(x)) {
-        nm <- names(x)
-        n <- length(x)
-        x <- unlist(x)
-        nL <- length(x)
-        x <- matrix(x, n, nL/n, byrow = TRUE)
-        rownames(x) <- nm
+        if (class(x) == "DNAbin") x <- as.matrix(x)
+        else {
+            nm <- names(x)
+            n <- length(x)
+            x <- unlist(x)
+            nL <- length(x)
+            x <- matrix(x, n, nL/n, byrow = TRUE)
+            rownames(x) <- nm
+        }
     }
     boot.tree <- vector("list", B)
     for (i in 1:B) {
index 17f7497914763f795719b2073cc5fabaf7ee0a91..2a0179c4d6538fa294674dde6cfaffb603711fe4 100644 (file)
@@ -1,8 +1,8 @@
-## ltt.plot.R (2007-12-22)
+## ltt.plot.R (2008-02-22)
 
 ##    Lineages Through Time Plot
 
-## Copyright 2002-2007 Emmanuel Paradis
+## Copyright 2002-2008 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -12,8 +12,8 @@ ltt.plot <- function(phy, xlab = "Time", ylab = "N", ...)
     if (class(phy) != "phylo") stop('object "phy" is not of class "phylo"')
     time <- sort(branching.times(phy), decreasing = TRUE)
     N <- 1:(length(time) + 1)
-    plot(-c(time, 0), N, xlab = xlab, ylab = ylab,
-         xaxs = "r", yaxs = "r", type = "S", ...)
+    plot.default(-c(time, 0), N, xlab = xlab, ylab = ylab,
+                 xaxs = "r", yaxs = "r", type = "S", ...)
 }
 
 ltt.lines <- function(phy, ...)
@@ -24,7 +24,7 @@ ltt.lines <- function(phy, ...)
 }
 
 mltt.plot <- function(phy, ..., dcol = TRUE, dlty = FALSE, legend = TRUE,
-                      xlab = "Time", ylab = "N")
+                      xlab = "Time", ylab = "N", log = "")
 {
     ltt.xy <- function(phy) {
         x <- -c(sort(branching.times(phy), decreasing = TRUE), 0)
@@ -38,6 +38,9 @@ mltt.plot <- function(phy, ..., dcol = TRUE, dlty = FALSE, legend = TRUE,
     } else { # a list of trees
         TREES <- lapply(phy, ltt.xy)
         names(TREES) <- names(phy)
+        if (is.null(names(TREES)))
+            names(TREES) <-
+                paste(deparse(substitute(phy)), "-", 1:length(TREES))
     }
     dts <- list(...)
     n <- length(dts)
@@ -51,6 +54,9 @@ mltt.plot <- function(phy, ..., dcol = TRUE, dlty = FALSE, legend = TRUE,
             } else { # a list of trees
                 a <- lapply(dts[[i]], ltt.xy)
                 names(a) <- names(dts[[i]])
+                if (is.null(names(a)))
+                    names(a) <-
+                        paste(deparse(substitute(phy)), "-", 1:length(a))
             }
             TREES <- c(TREES, a)
         }
@@ -59,8 +65,8 @@ mltt.plot <- function(phy, ..., dcol = TRUE, dlty = FALSE, legend = TRUE,
     xl <- c(min(unlist(lapply(TREES, function(x) min(x[, 1])))), 0)
     yl <- c(1, max(unlist(lapply(TREES, function(x) max(x[, 2])))))
 
-    plot(0, 0, type = "n", xlim = xl, ylim = yl, xaxs = "r", yaxs = "r",
-         xlab = xlab, ylab = ylab)
+    plot.default(1, 1, type = "n", xlim = xl, ylim = yl, xaxs = "r",
+                 yaxs = "r", xlab = xlab, ylab = ylab, log = log)
 
     lty <- if (!dlty) rep(1, n) else 1:n
     col <- if (!dcol) rep(1, n) else topo.colors(n)
index fd87d85e9a053efe9e25f08e6614744b446a04bb..0b735971d414150d87125a975e7993a4d4845277 100644 (file)
@@ -1,4 +1,4 @@
-## nodelabels.R (2008-02-08)
+## nodelabels.R (2008-02-21)
 
 ##   Labelling Trees
 
@@ -106,9 +106,10 @@ BOTHlabels <- function(text, sel, XX, YY, adj, frame, pch, thermo,
     if (!is.null(pie)) {
         if (is.vector(pie)) pie <- cbind(pie, 1 - pie)
         xrad <- CEX * diff(par("usr")[1:2]) / 50
+        xrad <- rep(xrad, length(sel))
         for (i in 1:length(sel))
           floating.pie.asp(XX[i], YY[i], pie[i, ],
-                           radius = xrad, col = piecol)
+                           radius = xrad[i], col = piecol)
     }
     if (!is.null(text)) text(XX, YY, text, adj = adj, col = col, ...)
     if (!is.null(pch)) points(XX + adj[1] - 0.5, YY + adj[2] - 0.5,
index 9d0b9292ac5605493ba46ea3f5f57ba1d3c71f8d..b090250b553eaa732b6facdbaa236e11b754e7a9 100644 (file)
@@ -6,8 +6,8 @@
 \usage{
 ltt.plot(phy, xlab = "Time", ylab = "N", ...)
 ltt.lines(phy, ...)
-mltt.plot(phy, ..., dcol = TRUE, dlty = FALSE,
-          legend = TRUE, xlab = "Time", ylab = "N")
+mltt.plot(phy, ..., dcol = TRUE, dlty = FALSE, legend = TRUE,
+          xlab = "Time", ylab = "N", log = ""))
 }
 \arguments{
   \item{phy}{an object of class \code{"phylo"}; this could be an object
@@ -27,6 +27,9 @@ mltt.plot(phy, ..., dcol = TRUE, dlty = FALSE,
     \code{FALSE}).}
   \item{legend}{a logical specifying whether a legend should be
     plotted.}
+  \item{log}{a character string specifying which axis(es) to be
+    log-transformed; must be one of the followings: \code{""},
+    \code{"x"}, \code{"y"}, or \code{"xy"}.}
 }
 \description{
   These functions plot, on the current graphical device, the minimum