]> git.donarmstrong.com Git - ape.git/commitdiff
a few changes and one bug fix
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 19 Oct 2010 14:38:43 +0000 (14:38 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 19 Oct 2010 14:38:43 +0000 (14:38 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@132 6e262413-ae40-0410-9e79-b911bd7a66b7

ChangeLog
DESCRIPTION
R/DNA.R
R/birthdeath.R
man/bd.time.Rd
man/rlineage.Rd

index 05ff24194a9cf674a7e75788a4e96ac75d1fd4be..b4a7e8a377c17ed2308d424dfcf3f608363c71e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
 
 BUG FIXES
 
+    o as.list.DNAbin() did not work correctly with vectors.
+
     o as.hclust.phylo() failed with trees with node labels (thanks to
       Filipe Vieira for the fix).
 
index 014fd6f9c0272028f2920873b60ef2162d3f8963..e165f27fbecb9593f8f2ab6427abb0394c943d79 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.6-1
-Date: 2010-09-30
+Date: 2010-10-19
 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/R/DNA.R b/R/DNA.R
index a7285170ec3aef68cf4874043ae6386edd034d30..722f7b4b9c9cabe100f3a7cd30deed790ff354cb 100644 (file)
--- a/R/DNA.R
+++ b/R/DNA.R
@@ -1,4 +1,4 @@
-## DNA.R (2010-09-01)
+## DNA.R (2010-10-19)
 
 ##   Manipulations and Comparisons of DNA Sequences
 
@@ -94,7 +94,7 @@ as.matrix.DNAbin <- function(x, ...)
 as.list.DNAbin <- function(x, ...)
 {
     if (is.list(x)) return(x)
-    if (is.vector(x)) obj <- list(x)
+    if (is.null(dim(x))) obj <- list(x) # cause is.vector() doesn't work
     else { # matrix
         n <- nrow(x)
         obj <- vector("list", n)
index 82decda388a03454f9b988e1f5dd9f39de834846..4c65ecd9248e1b1ca497bdc16957f4bcbc208e4e 100644 (file)
@@ -1,4 +1,4 @@
-## birthdeath.R (2009-05-10)
+## birthdeath.R (2010-10-17)
 
 ##   Estimation of Speciation and Extinction Rates
 ##             with Birth-Death Models
@@ -6,7 +6,7 @@
 ## birthdeath: standard model
 ## bd.ext: extended version
 
-## Copyright 2002-2009 Emmanuel Paradis
+## Copyright 2002-2010 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -17,6 +17,7 @@ birthdeath <- function(phy)
     N <- length(phy$tip.label)
     x <- c(NA, branching.times(phy))
     dev <- function(a, r) {
+        if (r <= 0) return(1e50)
         -2 * (lfactorial(N - 1)
               + (N - 2) * log(r)
               + r * sum(x[3:N])
index 8cafdcadd3d5ccce5d2d9692ad81bfa81d248199..b33d8d05a1a0200ca2addcb90d2ea77bd5e58ed2 100644 (file)
@@ -58,8 +58,8 @@ bd.time(phy, birth, death, BIRTH = NULL, DEATH = NULL,
 }}
 \references{
   Paradis, E. (2010) Time-dependent speciation and extinction from
-  phylogenies: a least squares approach. (under revision)
-  %\emph{Evolution}, \bold{59}, 1--12.
+  phylogenies: a least squares approach. \emph{Evolution} (in press)
+  %, \bold{59}, 1--12.
 }
 \author{Emmanuel Paradis}
 \seealso{
index dd36c0fed441ac17ba16edfe949f753b8b40fb9a..b2b1aed354c2fb780689216142543d5ef444dc22 100644 (file)
@@ -49,8 +49,8 @@ drop.fossil(phy, tol = 0)
   process. \emph{Annals of Mathematical Statistics}, \bold{19}, 1--15.
 
   Paradis, E. (2010) Time-dependent speciation and extinction from
-  phylogenies: a least squares approach. (under revision)
-  %\emph{Evolution}, \bold{59}, 1--12.
+  phylogenies: a least squares approach. \emph{Evolution} (in press)
+  %, \bold{59}, 1--12.
 }
 \author{Emmanuel Paradis}
 \seealso{