Package: ape
Version: 2.8-1
-Date: 2011-11-10
+Date: 2011-11-11
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, Andrei-Alin Popescu, Klaus Schliep, Korbinian Strimmer, Damien de Vienne
Maintainer: Emmanuel Paradis <Emmanuel.Paradis@ird.fr>
o mantel.test() could return P-values > 1 with the default
two-tailed test.
+ o extract.clade() sometimes shuffled some tip labels (thanks to
+ Ludovic Mallet and Mahendra Mariadassou for the fix).
+
OTHER CHANGES
o The code of yule() has been simplified and is now much faster for
big trees.
+ o The code of mantel.test() has been adjusted to be consistent
+ with common permutation tests.
+
CHANGES IN APE VERSION 2.8
-## drop.tip.R (2011-05-19)
+## drop.tip.R (2011-11-21)
## Remove Tips in a Phylogenetic Tree
if (wbl) phy$edge.length <- phy$edge.length[keep]
TIPS <- phy$edge[, 2] <= Ntip
tip <- phy$edge[TIPS, 2]
- phy$tip.label <- phy$tip.label[sort(tip)] # <- added sort to avoid shuffling of tip labels (2010-07-21)
+ ## Fix by Ludovic Mallet and Mahendra Mariadassou (2011-11-21):
+ name <- vector("character", length(tip))
+ name[order(tip)] <- phy$tip.label[tip]
+ phy$tip.label <- name
+ ## End of fix
## keep the ordering so no need to reorder tip.label:
phy$edge[TIPS, 2] <- order(tip)
if (!is.null(phy$node.label))
-## mantel.test.R (2011-11-10)
+## mantel.test.R (2011-11-11)
## Mantel Test for Similarity of Two Matrices
-## Copyright 2002-2006 Ben Bolker and Julien Claude
+## Copyright 2002-2011 Ben Bolker and Julien Claude
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
m[col(m) <= row(m)]
}
-mantel.test <- function(m1, m2, nperm = 1000, graph = FALSE,
+mantel.test <- function(m1, m2, nperm = 999, graph = FALSE,
alternative = "two.sided", ...)
{
alternative <- match.arg(alternative, c("two.sided", "less", "greater"))
realz <- mant.zstat(m1, m2)
nullstats <- replicate(nperm, mant.zstat(m1, perm.rowscols(m2, n)))
pval <- switch(alternative,
- "two.sided" = 2 * min(sum(nullstats > realz), sum(nullstats < realz)),
- "less" = sum(nullstats < realz),
- "greater" = sum(nullstats > realz))
- pval <- pval / nperm
+ "two.sided" = 2 * min(sum(nullstats >= realz), sum(nullstats <= realz)),
+ "less" = sum(nullstats <= realz),
+ "greater" = sum(nullstats >= realz))
+ pval <- (pval + 1) / (nperm + 1) # 'realz' is included in 'nullstats'
if (graph) {
plot(density(nullstats), type = "l", ...)
abline(v = realz)
Significant bug fixes were provided by Cécile Ané, Jeremy Beaulieu,
James Bullard, Otto Cordero, Éric Durand, Olivier François, Rich
-FitzJohn, Jos Käfer, Bret Larget, Naim Matasci, Nick Matzke, Michael
-Phelan, Elizabeth Purdom, Dan Rabosky, Filipe Vieira, Tim Wallstrom,
-Li-San Wang, Yan Wong, Peter Wragg, Janet Young, and Jinlong Zhang.
-Contact me if I forgot someone.
+FitzJohn, Jos Käfer, Bret Larget, Ludovic Mallet, Mahendra
+Mariadassou, Naim Matasci, Nick Matzke, Michael Phelan, Elizabeth
+Purdom, Dan Rabosky, Filipe Vieira, Tim Wallstrom, Li-San Wang, Yan
+Wong, Peter Wragg, Janet Young, and Jinlong Zhang. Contact me if I
+forgot someone.
Kurt Hornik, of the R Core Team, helped in several occasions to
fix some problems and bugs.
\alias{mantel.test}
\title{Mantel Test for Similarity of Two Matrices}
\usage{
-mantel.test(m1, m2, nperm = 1000, graph = FALSE,
+mantel.test(m1, m2, nperm = 999, graph = FALSE,
alternative = "two.sided", ...)
}
\arguments{