]> git.donarmstrong.com Git - ape.git/blob - man/nj.Rd
various corrections
[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 \author{Emmanuel Paradis}
23 \seealso{
24   \code{\link{write.tree}}, \code{\link{read.tree}},
25   \code{\link{dist.dna}}, \code{\link{bionj}},
26   \code{\link{fastme}}
27 }
28 \examples{
29 ### From Saitou and Nei (1987, Table 1):
30 x <- c(7, 8, 11, 13, 16, 13, 17, 5, 8, 10, 13,
31        10, 14, 5, 7, 10, 7, 11, 8, 11, 8, 12,
32        5, 6, 10, 9, 13, 8)
33 M <- matrix(0, 8, 8)
34 M[row(M) > col(M)] <- x
35 M[row(M) < col(M)] <- x
36 rownames(M) <- colnames(M) <- 1:8
37 tr <- nj(M)
38 plot(tr, "u")
39 ### a less theoretical example
40 data(woodmouse)
41 trw <- nj(dist.dna(woodmouse))
42 plot(trw)
43 }
44 \keyword{models}