]> git.donarmstrong.com Git - ape.git/blobdiff - man/rtree.Rd
final commit for ape 3.0-8
[ape.git] / man / rtree.Rd
index 63cbf79e5f8a2c1f74602c0845be3140bb2f5fdc..514f39bbdbf1ec9a50c73329fb178d1c96b9ec00 100644 (file)
@@ -1,10 +1,17 @@
 \name{rtree}
 \alias{rtree}
 \alias{rcoal}
+\alias{rmtree}
 \title{Generates Random Trees}
+\description{
+  These functions generate trees by splitting randomly the edges
+  (\code{rtree}) or randomly clustering the tips (\code{rcoal}).
+  \code{rtree} generates general trees, and \code{rcoal} generates
+  coalescent trees. The algorithms are described in Paradis (2012).
+}
 \usage{
 rtree(n, rooted = TRUE, tip.label = NULL, br = runif, ...)
-rcoal(n, tip.label = NULL, br = rexp, ...)
+rcoal(n, tip.label = NULL, br = "coalescent", ...)
 rmtree(N, n, rooted = TRUE, tip.label = NULL, br = runif, ...)
 }
 \arguments{
@@ -13,35 +20,38 @@ rmtree(N, n, rooted = TRUE, tip.label = NULL, br = runif, ...)
     (the default).}
   \item{tip.label}{a character vector giving the tip labels; if not
     specified, the tips "t1", "t2", ..., are given.}
-  \item{br}{either an R function used to generate the branch lengths
-    (\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{br}{one of the following: (i) an \R function used to generate the
+    branch lengths (\code{rtree}; use \code{NULL} to simulate only a
+    topology), or the coalescence times (\code{rcoal}); (ii) a character
+    to simulate a genuine coalescent tree for \code{rcoal} (the
+    default); or (iii) a numeric vector for the branch lengths or the
+    coalescence times.}
+  \item{\dots}{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{rtree}) or randomly clustering the tips (\code{rcoal}).
-  \code{rtree} generates general (non-ultrametric) trees, and
-  \code{rcoal} generates coalescent (ultrametric) trees.
-}
 \details{
   The trees generated are bifurcating. If \code{rooted = FALSE} in
-  (\code{rtree}), the tree is trifurcating at its `root'.
+  (\code{rtree}), the tree is trifurcating at its root.
 
   The default function to generate branch lengths in \code{rtree} is
-  \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{runif}. 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
+  \code{rmtree} calls successively \code{rtree} 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}}
+\references{
+  Paradis, E. (2012) \emph{Analysis of Phylogenetics and Evolution with
+    R (Second Edition).} New York: Springer.
+}
+\author{Emmanuel Paradis}
+\seealso{
+  \code{\link{stree}}, \code{\link{rlineage}}
+}
 \examples{
 layout(matrix(1:9, 3, 3))
 ### Nine random trees: