3 \title{Compute and Set Branching Times}
5 This function computes the branch lengths of a tree giving its
6 branching times (aka node ages or heights).
9 compute.brtime(phy, method = "coalescent", force.positive = NULL)
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).}
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.
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.
32 An object of class \code{"phylo"} with branch lengths and ultrametric.
34 \author{Emmanuel Paradis}
36 \code{\link{compute.brlen}}, \code{\link{branching.times}}
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()