From: paradis Date: Thu, 4 Aug 2011 11:00:29 +0000 (+0000) Subject: fix in c.multiPhylo() X-Git-Url: https://git.donarmstrong.com/?p=ape.git;a=commitdiff_plain;h=c14b15358e1f21302d929a980484e9f08c748c20 fix in c.multiPhylo() git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@167 6e262413-ae40-0410-9e79-b911bd7a66b7 --- diff --git a/NEWS b/NEWS index 92a114a..0fb7119 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,8 @@ BUG FIXES incompatible splits occur in 50% of the trees (especially with small number of trees). + o c() with "multiPhylo" did not work correctly. + CHANGES IN APE VERSION 2.7-2 diff --git a/R/DNA.R b/R/DNA.R index 63306ef..df5b892 100644 --- a/R/DNA.R +++ b/R/DNA.R @@ -359,7 +359,7 @@ dist.dna <- function(x, model = "K80", variance = FALSE, gamma = FALSE, stop(paste("'model' must be one of:", paste("\"", MODELS, "\"", sep = "", collapse = " "))) if (imod == 11 && variance) { - warning("computing variance temporarily not available for model BH87.") + warning("computing variance not available for model BH87.") variance <- FALSE } if (gamma && imod %in% c(1, 5:7, 9:15)) { diff --git a/R/compute.brtime.R b/R/compute.brtime.R index 727fcb6..822f6f2 100644 --- a/R/compute.brtime.R +++ b/R/compute.brtime.R @@ -1,4 +1,4 @@ -## compute.brtime.R (2011-07-15) +## compute.brtime.R (2011-07-26) ## Compute and Set Branching Times @@ -19,9 +19,9 @@ compute.brtime <- ## x: branching times (aka, node ages or heights) if (identical(method, "coalescent")) { # the default - x <- 2 * rexp(n - 1)/(as.double(n:2) * as.double((n - 1):1)) - if (is.null(force.positive)) - force.positive <- TRUE + x <- 2 * rexp(m)/(as.double((m + 1):2) * as.double(m:1)) + ## x <- 2 * rexp(n - 1)/(as.double(n:2) * as.double((n - 1):1)) + if (is.null(force.positive)) force.positive <- TRUE } else if (is.numeric(method)) { x <- as.vector(method) if (length(x) != m) diff --git a/R/summary.phylo.R b/R/summary.phylo.R index e44d48d..715021b 100644 --- a/R/summary.phylo.R +++ b/R/summary.phylo.R @@ -1,8 +1,8 @@ -## summary.phylo.R (2010-11-03) +## summary.phylo.R (2011-08-04) ## Print Summary of a Phylogeny and "multiPhylo" operators -## Copyright 2003-2010 Emmanuel Paradis, and 2006 Ben Bolker +## Copyright 2003-2011 Emmanuel Paradis, and 2006 Ben Bolker ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. @@ -70,18 +70,6 @@ summary.phylo <- function(object, ...) } } - if (!is.null(attr(object, "loglik"))) { - cat("Phylogeny estimated by maximum likelihood.\n") - cat(" log-likelihood:", attr(object, "loglik"), "\n\n") - npart <- length(attr(object, "para")) - for (i in 1:npart) { - cat("partition ", i, ":\n", sep = "") - print(attr(object, "para")[[i]]) - if (i == 1) next - else cat(" contrast parameter (xi):", - attr(object, "xi")[i - 1], "\n") - } - } } ### by BB: @@ -100,7 +88,7 @@ print.phylo <- function(x, printlen = 6,...) cat("\tNode labels:\n") if (nb.node > printlen) { cat(paste("\t", paste(x$node.label[1:printlen], - collapse=", "), ",...\n", sep = "")) + collapse=", "), ", ...\n", sep = "")) } else print(x$node.label) } rlab <- if (is.rooted(x)) "Rooted" else "Unrooted" @@ -157,8 +145,8 @@ c.multiPhylo <- function(..., recursive = FALSE) n <- length(obj) x <- obj[[1L]] N <- length(x) - i <- 1L - while (i < n) { + i <- 2L + while (i <= n) { a <- N + 1L N <- N + length(obj[[i]]) ## x is of class "multiPhylo", so this uses the operator below: