]> git.donarmstrong.com Git - ape.git/commitdiff
bug fixed in ltt.plot.R
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Sat, 20 Dec 2008 16:45:04 +0000 (16:45 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Sat, 20 Dec 2008 16:45:04 +0000 (16:45 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@56 6e262413-ae40-0410-9e79-b911bd7a66b7

ChangeLog
DESCRIPTION
R/ltt.plot.R

index 8891e33091e47f5e69e6c3dce93857bb91a74b69..5a2243512b88688366a501473e8fabd033616fdd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@ BUG FIXES
       multiple lines with different numbers of lines and/or with
       comments inserted within the trees).
 
+    o ltt.plot(), ltt.lines(), and mltt.plot() did not count correctly
+      the number of lineages with non-binary trees.
+
 
 
                CHANGES IN APE VERSION 2.2-2
index 74b1a1d401d9965794eebca66816da0fb12c52b8..7c5ae46aac96c11b082be641083d7fa06bae2486 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.2-3
-Date: 2008-11-24
+Date: 2008-12-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,
index 2a0179c4d6538fa294674dde6cfaffb603711fe4..6421e8b0d9f1366648e432e23c4ad22d63223ca0 100644 (file)
@@ -1,4 +1,4 @@
-## ltt.plot.R (2008-02-22)
+## ltt.plot.R (2008-12-20)
 
 ##    Lineages Through Time Plot
 
@@ -10,6 +10,7 @@
 ltt.plot <- function(phy, xlab = "Time", ylab = "N", ...)
 {
     if (class(phy) != "phylo") stop('object "phy" is not of class "phylo"')
+    if (!is.binary.tree(phy)) phy <- multi2di(phy)
     time <- sort(branching.times(phy), decreasing = TRUE)
     N <- 1:(length(time) + 1)
     plot.default(-c(time, 0), N, xlab = xlab, ylab = ylab,
@@ -18,6 +19,7 @@ ltt.plot <- function(phy, xlab = "Time", ylab = "N", ...)
 
 ltt.lines <- function(phy, ...)
 {
+    if (!is.binary.tree(phy)) phy <- multi2di(phy)
     time <- sort(branching.times(phy), decreasing = TRUE)
     N <- 1:(length(time) + 1)
     lines(-c(time, 0), N, type = "S", ...)
@@ -27,6 +29,7 @@ mltt.plot <- function(phy, ..., dcol = TRUE, dlty = FALSE, legend = TRUE,
                       xlab = "Time", ylab = "N", log = "")
 {
     ltt.xy <- function(phy) {
+        if (!is.binary.tree(phy)) phy <- multi2di(phy)
         x <- -c(sort(branching.times(phy), decreasing = TRUE), 0)
         names(x) <- NULL
         y <- 1:length(x)