]> git.donarmstrong.com Git - ape.git/commitdiff
various bug fixes
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 21 Jun 2011 11:31:21 +0000 (11:31 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 21 Jun 2011 11:31:21 +0000 (11:31 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@161 6e262413-ae40-0410-9e79-b911bd7a66b7

DESCRIPTION
NEWS
R/bind.tree.R
R/rTrait.R
man/rTraitCont.Rd
man/rTraitDisc.Rd

index 62844194183c4df38533d7fcac8775dfa6b51b65..269ff2dfa095999b116905b064365b7e84c94be7 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.7-3
-Date: 2011-06-14
+Date: 2011-06-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, 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 0bc534026eecdbe12c860c5507e8d876af52e79c..a5c311cf221987f3faa3005e0876d374cbd09743 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,10 @@
                CHANGES IN APE VERSION 2.7-3
 
 
-NEW FEATURES
+BUG FIXES
 
-    o There is a new predict() method for compar.gee().
+    o Branch lengths were wrongly updated with bind.tree(, where = <tip>,
+      position = 0). (Thanks to Liam Revell for digging this bug out.)
 
 
 
@@ -17,6 +18,9 @@ NEW FEATURES
       and four conversion methods to the classes "phylo", "networx",
       "network", and "igraph".
 
+    o The new function rTraitMult does multivariate traits simulation
+      with user-defined models.
+
     o plot.phylo() has a new option 'plot = TRUE'. If FALSE, the tree
       is not plotted but the graphical device is set and the
       coordinates are saved as usual.
@@ -30,6 +34,8 @@ NEW FEATURES
     o boot.phylo() now displays a progress bar by default (can be off
       if 'quiet = TRUE').
 
+    o There is a new predict() method for compar.gee().
+
 
 BUG FIXES
 
@@ -44,6 +50,12 @@ BUG FIXES
       presence of identical or nearly identical sequences.
 
 
+OTHER CHANGES
+
+    o The data bird.families, bird.orders, cynipids, and woodmouse are
+      now provided as .rda files.
+
+
 
                CHANGES IN APE VERSION 2.7-1
 
index 58d7caba4a4a9831652ea6a159d976cb8b07c87f..cc7ee1ff3a055ca837889415b3d48c2cf2161d7c 100644 (file)
@@ -1,4 +1,4 @@
-## bind.tree.R (2011-03-02)
+## bind.tree.R (2011-06-21)
 
 ##    Bind Trees
 
@@ -146,8 +146,8 @@ bind.tree <- function(x, y, where = "root", position = 0, interactive = FALSE)
                 y$edge[1] <- x$edge[i, 1]
                 ## delete i-th edge in x:
                 x$edge <- x$edge[-i, ]
-                i <- i - 1L
                 if (wbl) x$edge.length <- x$edge.length[-i]
+                i <- i - 1L
             }
             x$tip.label <- x$tip.label[-where]
             ## renumber the tips that need to:
index 2c18d0940af08ada1fcaf1a67c8cba9b5402b1ed..6731c5cf94526939a767158e9d2f5cebf3bf0174 100644 (file)
@@ -1,4 +1,4 @@
-## rTrait.R (2011-04-02)
+## rTrait.R (2011-06-16)
 
 ##   Trait Evolution
 
@@ -135,7 +135,7 @@ rTraitCont <-
 
 rTraitMult <-
     function(phy, model, p = 1, root.value = rep(0, p), ancestor = FALSE,
-             as.factor = NULL, ...)
+             asFactor = NULL, trait.labels = paste("x", 1:p, sep = ""), ...)
 {
     phy <- reorder(phy, "pruningwise")
     n <- length(phy$tip.label)
@@ -152,6 +152,8 @@ rTraitMult <-
     el <- phy$edge.length
     if (is.null(el)) el <- numeric(N)
 
+    environment(model) <- environment() # to find 'p'
+
     for (i in N:1) x[des[i], ] <- model(x[anc[i], ], el[i], ...)
 
     if (ancestor) {
@@ -162,8 +164,9 @@ rTraitMult <-
         rownames(x) <- phy$tip.label
     }
     x <- as.data.frame(x)
-    if (!is.null(as.factor)) {
-        for (i in as.factor) {
+    names(x) <- trait.labels
+    if (!is.null(asFactor)) {
+        for (i in asFactor) {
             y <- x[, i]
             x[, i] <- factor(y, labels = LETTERS[1:length(unique(y))])
         }
index 908bf009601262483a8f23722c1cfb3a192035c5..8a72487a777a032bf8d7ed5f795dcb3775689d06 100644 (file)
@@ -78,7 +78,7 @@ rTraitCont(phy, model = "BM", sigma = 0.1, alpha = 1, theta = 0,
 }
 \author{Emmanuel Paradis}
 \seealso{
-  \code{\link{rTraitDisc}}, \code{\link{ace}}
+  \code{\link{rTraitDisc}}, \code{\link{rTraitMult}}, \code{\link{ace}}
 }
 \examples{
 data(bird.orders)
index b6b619c0394704c074cfcaca6d0d8a13d464da00..e2c43d9d7b4264f0f54822f065f5e4c829634be5 100644 (file)
@@ -65,7 +65,7 @@ rTraitDisc(phy, model = "ER", k = if (is.matrix(model)) ncol(model) else 2,
 }
 \author{Emmanuel Paradis}
 \seealso{
-  \code{\link{rTraitCont}}, \code{\link{ace}}
+  \code{\link{rTraitCont}}, \code{\link{rTraitMult}}, \code{\link{ace}}
 }
 \examples{
 data(bird.orders)