]> git.donarmstrong.com Git - ape.git/blob - man/compute.brtime.Rd
fix from Pierre Legendre
[ape.git] / man / compute.brtime.Rd
1 \name{compute.brtime}
2 \alias{compute.brtime}
3 \title{Compute and Set Branching Times}
4 \description{
5   This function computes the branch lengths of a tree giving its
6   branching times (aka node ages or heights).
7 }
8 \usage{
9 compute.brtime(phy, method = "coalescent", force.positive = NULL)
10 }
11 \arguments{
12   \item{phy}{an object of class \code{"phylo"}.}
13   \item{method}{either \code{"coalescent"} (the default), or a numeric
14     vector giving the branching times.}
15   \item{force.positive}{a logical value (see details).}
16 }
17 \details{
18   By default, a set of random branching times is generated from a simple
19   coalescent, and the option \code{force.positive} is set to \code{TRUE}
20   so that no branch length is negative.
21
22   If a numeric vector is passed to \code{method}, it is taken as the
23   branching times of the nodes with respect to their numbers (i.e., the
24   first element of \code{method} is the branching time of the node
25   numbered \eqn{n + 1} [= the root], the second element of the node
26   numbered \eqn{n + 2}, and so on), so \code{force.positive} is set to
27   \code{FALSE}. This may result in negative branch lengths. To avoid
28   this, one should use \code{force.positive = TRUE} in which case the
29   branching times are eventually reordered.
30 }
31 \value{
32   An object of class \code{"phylo"} with branch lengths and ultrametric.
33 }
34 \author{Emmanuel Paradis}
35 \seealso{
36   \code{\link{compute.brlen}}, \code{\link{branching.times}}
37 }
38 \examples{
39 tr <- rtree(10)
40 layout(matrix(1:4, 2))
41 plot(compute.brtime(tr)); axisPhylo()
42 plot(compute.brtime(tr, force.positive = FALSE)); axisPhylo()
43 plot(compute.brtime(tr, 1:9)); axisPhylo() # a bit nonsense
44 plot(compute.brtime(tr, 1:9, TRUE)); axisPhylo()
45 layout(1)
46 }
47 \keyword{manip}