https://github.com/cran/ape
Raw File
Tip revision: e566404f3d03faad3cbdb5850f96ccbb1eafc679 authored by Emmanuel Paradis on 02 November 2004, 00:00:00 UTC
version 1.3-1
Tip revision: e566404
rtree.Rd
\name{rtree}
\alias{rtree}
\title{Generates Random Trees}
\usage{
rtree(n, br = TRUE)
}
\arguments{
  \item{n}{an integer giving the number of tips in the tree.}
  \item{br}{a logical specifying whether the tree should have branch
    lengths (default is \code{TRUE}).}
}
\description{
  This function generates a tree by splitting randomly the edges until
  the specified number of tips is obtained.
}
\details{
  If \code{br = TRUE}, branch lengths are taken from a uniform
  distribution on [0, 1].

  This is an experimental function and is not intended to generate trees
  with given statistical characteristics (at least for the moment). Its
  present purpose is to give a tree of a specified size in an easy
  way. To get an ultrametric tree, one may apply the function
  \code{\link{chronogram}} to the tree generated by \code{rtree}.
}
\author{Emmanuel Paradis \email{paradis@isem.univ-montp2.fr}}
\examples{
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")
layout(matrix(1))
}
\keyword{datagen}
back to top