rtree
) or randomly clustering the tips (rcoal
).
rtree
generates general (non-ultrametric) trees, and
rcoal
generates coalescent (ultrametric) trees.rtree(n, rooted = TRUE, tip.label = NULL, br = runif, ...)
rcoal(n, tip.label = NULL, br = rexp, ...)
rtree
) or the coalescence times (rcoal
), or
NULL
to gave no branch lengths in the tree.br
.rooted = FALSE
in
(rtree
), the tree is trifurcating at its `root'. The default function to generate branch lengths in rtree
is
runif
. In rcoal
rexp
is used to generate the
inter-node distances. If further arguments are passed to br
,
they need to be tagged (e.g., min = 0, max = 10
).
layout(matrix(1:9, 3, 3))
### Nine random trees:
for (i in 1:9) plot(rtree(20))
### Nine random cladograms:
for (i in 1:9) plot(rtree(20, FALSE), type = "c")
### generate 4 random trees of bird orders:
data(bird.orders)
layout(matrix(1:4, 2, 2))
for (i in 1:4)
plot(rcoal(23, tip.label = bird.orders$tip.label), no.margin = TRUE)
layout(matrix(1))
Run the code above in your browser using DataLab