Package: ape
-Version: 2.1
-Date: 2008-01-03
+Version: 2.1-1
+Date: 2008-01-08
Title: Analyses of Phylogenetics and Evolution
Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong,
Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel,
-## rtree.R (2007-12-22)
+## rtree.R (2008-01-08)
## Generates Random Trees
-## Copyright 2004-2007 Emmanuel Paradis
+## Copyright 2004-2008 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
## to avoid crossings when converting with as.hclust:
read.tree(text = write.tree(phy))
}
+
+rmtree <- function(N, n, rooted = TRUE, tip.label = NULL, br = runif, ...)
+{
+ a <- replicate(N, rtree(n, rooted = rooted, tip.label = tip.label,
+ br = br, ...), simplify = FALSE)
+ class(a) <- "multiPhylo"
+ a
+}
\usage{
rtree(n, rooted = TRUE, tip.label = NULL, br = runif, ...)
rcoal(n, tip.label = NULL, br = rexp, ...)
+rmtree(N, n, rooted = TRUE, tip.label = NULL, br = runif, ...)
}
\arguments{
\item{n}{an integer giving the number of tips in the tree.}
(\code{rtree}) or the coalescence times (\code{rcoal}), or
\code{NULL} to give no branch lengths in the tree.}
\item{...}{further argument(s) to be passed to \code{br}.}
+ \item{N}{an integer giving the number of trees to generate.}
}
\description{
These functions generate trees by splitting randomly the edges
\code{runif}. In \code{rcoal} \code{rexp} is used to generate the
inter-node distances. If further arguments are passed to \code{br},
they need to be tagged (e.g., \code{min = 0, max = 10}).
+
+ \code{rmtree} calls successively \code{rmtree} and set the class of
+ the returned object appropriately.
+}
+\value{
+ An object of class \code{"phylo"} or of class \code{"multiPhylo"} in
+ the case of \code{rmtree}.
}
\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
\examples{