]> git.donarmstrong.com Git - ape.git/blob - man/nj.Rd
a few changes...
[ape.git] / man / nj.Rd
1 \name{nj}
2 \alias{nj}
3 \title{Neighbor-Joining Tree Estimation}
4 \description{
5   This function performs the neighbor-joining tree estimation of Saitou
6   and Nei (1987).
7 }
8 \usage{
9 nj(X)
10 }
11 \arguments{
12   \item{X}{a distance matrix; may be an object of class ``dist''.}
13 }
14 \value{
15   an object of class \code{"phylo"}.
16 }
17 \references{
18   Saitou, N. and Nei, M. (1987) The neighbor-joining method: a new
19   method for reconstructing phylogenetic trees. \emph{Molecular Biology
20     and Evolution}, \bold{4}, 406--425.
21
22   Studier, J. A. and Keppler, K. J. (1988) A note on the
23   neighbor-joining algorithm of Saitou and Nei. \emph{Molecular Biology
24     and Evolution}, \bold{5}, 729--731.
25 }
26 \author{Emmanuel Paradis}
27 \seealso{
28   \code{\link{write.tree}}, \code{\link{read.tree}},
29   \code{\link{dist.dna}}, \code{\link{bionj}},
30   \code{\link{fastme}}
31 }
32 \examples{
33 ### From Saitou and Nei (1987, Table 1):
34 x <- c(7, 8, 11, 13, 16, 13, 17, 5, 8, 10, 13,
35        10, 14, 5, 7, 10, 7, 11, 8, 11, 8, 12,
36        5, 6, 10, 9, 13, 8)
37 M <- matrix(0, 8, 8)
38 M[lower.tri(M)] <- x
39 M <- t(M)
40 M[lower.tri(M)] <- x
41 dimnames(M) <- list(1:8, 1:8)
42 tr <- nj(M)
43 plot(tr, "u")
44 ### a less theoretical example
45 data(woodmouse)
46 trw <- nj(dist.dna(woodmouse))
47 plot(trw)
48 }
49 \keyword{models}