4 \title{Generates Random Trees}
6 rtree(n, rooted = TRUE, tip.label = NULL, br = runif, ...)
7 rcoal(n, tip.label = NULL, br = rexp, ...)
10 \item{n}{an integer giving the number of tips in the tree.}
11 \item{rooted}{a logical indicating whether the tree should be rooted
13 \item{tip.label}{a character vector giving the tip labels; if not
14 specified, the tips "t1", "t2", ..., are given.}
15 \item{br}{either an R function used to generate the branch lengths
16 (\code{rtree}) or the coalescence times (\code{rcoal}), or
17 \code{NULL} to give no branch lengths in the tree.}
18 \item{...}{further argument(s) to be passed to \code{br}.}
21 These functions generate trees by splitting randomly the edges
22 (\code{rtree}) or randomly clustering the tips (\code{rcoal}).
23 \code{rtree} generates general (non-ultrametric) trees, and
24 \code{rcoal} generates coalescent (ultrametric) trees.
27 The trees generated are bifurcating. If \code{rooted = FALSE} in
28 (\code{rtree}), the tree is trifurcating at its `root'.
30 The default function to generate branch lengths in \code{rtree} is
31 \code{runif}. In \code{rcoal} \code{rexp} is used to generate the
32 inter-node distances. If further arguments are passed to \code{br},
33 they need to be tagged (e.g., \code{min = 0, max = 10}).
35 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
37 layout(matrix(1:9, 3, 3))
38 ### Nine random trees:
39 for (i in 1:9) plot(rtree(20))
40 ### Nine random cladograms:
41 for (i in 1:9) plot(rtree(20, FALSE), type = "c")
42 ### generate 4 random trees of bird orders:
44 layout(matrix(1:4, 2, 2))
46 plot(rcoal(23, tip.label = bird.orders$tip.label), no.margin = TRUE)