Package: ape
Version: 2.7-2
-Date: 2011-03-29
+Date: 2011-05-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>
is not plotted but the graphical device is set and the
coordinates are saved as normal.
+ o diversity.contrast.test() gains a fourth version of the test with
+ method = "logratio"; the literature citations have been clarified.
+
+
+BUG FIXES
+
+ o bionj() made R crash if distances were two large. It now returns
+ an error if at least one distance is greater than 100.
+
+ o drop.tip() returned a wrong tree if 'tip' was of zero length.
+
CHANGES IN APE VERSION 2.7-1
-## SlowinskiGuyer.R (2011-03-10)
+## SlowinskiGuyer.R (2011-05-05)
## Tests of Diversification Shifts with Sister-Clades
diversity.contrast.test <-
function(x, method = "ratiolog", alternative = "two.sided", nrep = 0, ...)
{
- method <- match.arg(method, c("ratiolog", "proportion", "difference"))
+ method <- match.arg(method, c("ratiolog", "proportion",
+ "difference", "logratio"))
alternative <- match.arg(alternative, c("two.sided", "less", "greater"))
minmax <- t(apply(x, 1, sort)) # sort all rows
log(minmax[, 2]) / log(minmax[, 1])
},
"proportion" = minmax[, 2] / (minmax[, 2] + minmax[, 1]),
- "difference" = abs(DIFF))
+ "difference" = abs(DIFF),
+ "logratio" = log(minmax[, 1] / minmax[, 2]))
y <- SIGN * CONTRAST # the signed contrasts
-## drop.tip.R (2010-11-24)
+## drop.tip.R (2011-05-19)
## Remove Tips in a Phylogenetic Tree
-## Copyright 2003-2010 Emmanuel Paradis
+## Copyright 2003-2011 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
{
if (!inherits(phy, "phylo"))
stop('object "phy" is not of class "phylo"')
+ if (!length(tip)) return(phy)
Ntip <- length(phy$tip.label)
## find the tips to drop:
-## me.R (2009-01-07)
+## me.R (2011-05-12)
## Tree Estimation Based on Minimum Evolution Algorithm
## Copyright 2007 Vincent Lefort with modifications by
-## Emmanuel Paradis (2008-2009)
+## Emmanuel Paradis (2008-2011)
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
bionj <- function(X)
{
if (is.matrix(X)) X <- as.dist(X)
+ if (any(X > 100))
+ stop("at least one distance was greater than 100")
N <- as.integer(attr(X, "Size"))
labels <- sprintf("%6s", 1:N)
edge1 <- edge2 <- integer(2*N - 3)
-## root.R (2010-02-11)
+## root.R (2011-04-29)
## Root of Phylogenetic Trees
-## Copyright 2004-2010 Emmanuel Paradis
+## Copyright 2004-2011 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
o[NEXT:(NEXT + ne - 1L)] <- s
if (fuseRoot) {
- phy$Nnode <- oldNnode - 1
+ phy$Nnode <- oldNnode - 1L
N <- N - 1L
}
phy$edge[INV, ] <- phy$edge[INV, 2:1]
}
}
## N <- N + 1L ... not needed
- phy$Nnode <- phy$Nnode + 1
+ phy$Nnode <- phy$Nnode + 1L
}
## The block below renumbers the nodes so that they conform
\arguments{
\item{X}{a distance matrix, may be an object of class ``dist''.}
\item{k}{an integer giving the number of intervals in the plot.}
- \item{plot}{a logival specifying whether to draw the
+ \item{plot}{a logical specifying whether to draw the
\eqn{\delta}{delta} plot (the default).}
\item{which}{a numeric vector indicating which plots are done; 1: the
histogram of the \eqn{\delta_q}{delta_q} values, 2: the plot of the
\arguments{
\item{x}{a matrix or a data frame with at least two columns: the first
one gives the number of species in clades with a trait supposed to
- increase or decrease diversification rate, and the second one the number of
- species in the sister-clades without the trait. Each
- row represents a pair of sister-clades.}
- \item{method}{a character string specifying the kind of test: \code{"ratiolog"} (default),
- \code{"proportion"}, \code{"difference"}, or any unambiguous
+ increase or decrease diversification rate, and the second one the
+ number of species in the sister-clades without the trait. Each row
+ represents a pair of sister-clades.}
+ \item{method}{a character string specifying the kind of test:
+ \code{"ratiolog"} (default), \code{"proportion"},
+ \code{"difference"}, \code{"logratio"}, or any unambiguous
abbreviation of these.}
\item{alternative}{a character string defining the alternative
hypothesis: \code{"two.sided"} (default), \code{"less"},
\code{"greater"}, or any unambiguous abbreviation of these.}
\item{nrep}{the number of replications of the randomization test; by
default, a Wilcoxon test is done.}
- \item{\dots}{arguments passed to the function \code{\link[stats]{wilcox.test}}.}
+ \item{\dots}{arguments passed to the function
+ \code{\link[stats]{wilcox.test}}.}
}
\details{
If \code{method = "ratiolog"}, the test described in Barraclough et
al. (1996) is performed. If \code{method = "proportion"}, the version
in Barraclough et al. (1995) is used. If \code{method = "difference"},
- then this is Wiegmann et al.'s (1993) version. Vamosi and Vamosi (2005)
- gave a detailed account of these three tests which are essentially
- different versions of the same test.
+ the signed difference is used (Sargent 2004). If \code{method =
+ "logratio"}, then this is Wiegmann et al.'s (1993) version. These
+ four tests are essentially different versions of the same test (Vamosi
+ and Vamosi 2005, Vamosi 2007).
If \code{nrep = 0}, a Wilcoxon test is done on the species diversity
contrasts with the null hypothesis is that they are distributed around
Barraclough, T. G., Harvey, P. H., and Nee, S. (1996) Rate of
\emph{rbc}L gene sequence evolution and species diversification in
flowering plants (angiosperms). \emph{Proceedings of the Royal Society
- of London. Series B. Biological Sciences}, \bold{263}, 589--591.
+ of London. Series B. Biological Sciences}, \bold{263}, 589--591.
+
+ Sargent, R. D. (2004) Floral symmetry affects speciation rates in
+ angiosperms. \emph{Proceedings of the Royal Society of London. Series
+ B. Biological Sciences}, \bold{271}, 603--608.
+
+ Vamosi, S. M. (2007) Endless tests: guidelines for analysing non-nested
+ sister-group comparisons. An addendum. \emph{Evolutionary Ecology
+ Research}, \bold{9}, 717.
Vamosi, S. M. and Vamosi, J. C. (2005) Endless tests: guidelines for
analysing non-nested sister-group comparisons. \emph{Evolutionary