]> git.donarmstrong.com Git - ape.git/blob - man/compute.brlen.Rd
various corrections
[ape.git] / man / compute.brlen.Rd
1 \name{compute.brlen}
2 \alias{compute.brlen}
3 \title{Branch Lengths Computation}
4 \usage{
5 compute.brlen(phy, method = "Grafen", power = 1, ...)
6 }
7 \arguments{
8   \item{phy}{an object of class \code{phylo} representing the tree.}
9   \item{method}{the method to be used to compute the branch lengths;
10     this must be one of the followings: (i) \code{"Grafen"} (the
11     default), (ii) a numeric vector, or (iii) a function.}
12   \item{power}{The power at which heights must be raised (see below).}
13   \item{\dots}{further argument(s) to be passed to \code{method} if it is
14     a function.}
15 }
16 \description{
17   This function computes branch lengths of a tree using different
18   methods.
19 }
20 \details{
21   Grafen's (1989) computation of branch lengths: each node is given a
22   `height', namely the number of leaves of the subtree minus one, 0 for
23   leaves. Each height is scaled so that root height is 1, and then
24   raised at power 'rho' (> 0). Branch lengths are then computed as the
25   difference between height of lower node and height of upper node.
26
27   If one or several numeric values are provided as \code{method}, they
28   are recycled if necessary. If a function is given instead, further
29   arguments are given in place of \code{...} (they must be named, see
30   examples).
31
32   Zero-length branches are not treated as multichotomies, and thus may
33   need to be collapsed (see \code{\link{di2multi}}).
34 }
35 \value{
36   An object of class \code{phylo} with branch lengths.
37 }
38 \author{Julien Dutheil \email{julien.dutheil@univ-montp2.fr} and
39   Emmanuel Paradis}
40 \references{
41   Grafen, A. (1989) The phylogenetic regression. \emph{Philosophical
42     Transactions of the Royal society of London. Series B. Biological
43     Sciences}, \bold{326}, 119--157.
44 }
45 \seealso{
46   \code{\link{read.tree}} for a description of \code{phylo} objects,
47   \code{\link{di2multi}}, \code{\link{multi2di}}
48 }
49 \examples{
50 data(bird.orders)
51 plot(compute.brlen(bird.orders, 1))
52 plot(compute.brlen(bird.orders, runif, min = 0, max = 5))
53 layout(matrix(1:4, 2, 2))
54 plot(compute.brlen(bird.orders, power=1), main=expression(rho==1))
55 plot(compute.brlen(bird.orders, power=3), main=expression(rho==3))
56 plot(compute.brlen(bird.orders, power=0.5), main=expression(rho==0.5))
57 plot(compute.brlen(bird.orders, power=0.1), main=expression(rho==0.1))
58 layout(1)
59 }
60 \keyword{manip}