CHANGES IN APE VERSION 2.6-3
+NEW FEATURES
+
+ o rTraitCont() and rTraitDisc() gains a '...' argument used with
+ user-defined models (suggestion by Gene Hunt).
+
+
BUG FIXES
o as.hclust.phylo() now returns an error with unrooted trees.
+ o as.hclust.phylo() failed with trees with node labels (thanks to
+ Jinlong Zhang for pointing this bug out).
+
CHANGES IN APE VERSION 2.6-2
Package: ape
Version: 2.6-3
-Date: 2010-12-14
+Date: 2010-12-24
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>
-## as.phylo.R (2010-12-14)
+## as.phylo.R (2010-12-15)
## Conversion Among Tree Objects
if (!is.binary.tree(x)) stop("the tree is not binary")
if (!is.rooted(x)) stop("the tree is not rooted")
n <- length(x$tip.label)
+ x$node.label <- NULL # by Jinlong Zhang (2010-12-15)
bt <- sort(branching.times(x))
inode <- as.numeric(names(bt))
N <- n - 1L
-## rTrait.R (2010-07-26)
+## rTrait.R (2010-12-24)
## Trait Evolution
rTraitDisc <-
function(phy, model = "ER", k = if (is.matrix(model)) ncol(model) else 2,
rate = 0.1, states = LETTERS[1:k], freq = rep(1/k, k),
- ancestor = FALSE, root.value = 1)
+ ancestor = FALSE, root.value = 1, ...)
{
if (is.null(phy$edge.length))
stop("tree has no branch length")
if (is.function(model)) {
environment(model) <- environment() # to find 'k'
- for (i in N:1) x[des[i]] <- model(x[anc[i]], el[i])
+ for (i in N:1) x[des[i]] <- model(x[anc[i]], el[i], ...)
} else {
freq <- rep(freq, each = k)
Q <- Q * freq
rTraitCont <-
function(phy, model = "BM", sigma = 0.1, alpha = 1, theta = 0,
- ancestor = FALSE, root.value = 0, linear = TRUE)
+ ancestor = FALSE, root.value = 0, linear = TRUE, ...)
{
if (is.null(phy$edge.length))
stop("tree has no branch length")
if (is.function(model)) {
environment(model) <- environment()
- for (i in N:1) x[des[i]] <- model(x[anc[i]], el[i])
+ for (i in N:1) x[des[i]] <- model(x[anc[i]], el[i], ...)
} else {
model <- pmatch(toupper(model), c("BM", "OU"))
if (length(sigma) == 1) sigma <- rep(sigma, N)
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, and Janet Young. Contact me if I
-forgot someone.
+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.
\title{Continuous Character Simulation}
\usage{
rTraitCont(phy, model = "BM", sigma = 0.1, alpha = 1, theta = 0,
- ancestor = FALSE, root.value = 0, linear = TRUE)
+ ancestor = FALSE, root.value = 0, linear = TRUE, ...)
}
\arguments{
\item{phy}{an object of class \code{"phylo"}.}
\item{root.value}{a numeric giving the value at the root.}
\item{linear}{a logical indicating which parameterisation of the OU
model to use (see details).}
+ \item{\dots}{further arguments passed to \code{model} if it is a
+ function.}
}
\description{
This function simulates the evolution of a continuous character along a
\item{root.value}{an integer giving the value at the root (by default,
it's the first state). To have a random value, use \code{root.value
= sample(k)}.}
+ \item{\dots}{further arguments passed to \code{model} if it is a
+ function.}
}
\description{
This function simulates the evolution of a discrete character along a