nj                    package:ape                    R Documentation

_N_e_i_g_h_b_o_r-_J_o_i_n_i_n_g _T_r_e_e _E_s_t_i_m_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     This function performs the neighbor-joining tree estimation of
     Saitou and Nei (1987).

_U_s_a_g_e:

     nj(X)

_A_r_g_u_m_e_n_t_s:

       X: a distance matrix; may be an object of class ``dist''.

_D_e_t_a_i_l_s:

     The argument may be a square matrix (e.g. as estimated by
     'dist.dna'), a 'dist' object (estimated by 'dist').

_V_a_l_u_e:

     an object of class '"phylo"'.

_A_u_t_h_o_r(_s):

     Emmanuel Paradis paradis@isem.univ-montp2.fr

_R_e_f_e_r_e_n_c_e_s:

     Saitou, N. and Nei, M. (1987) The neighbor-joining method: a new
     method for reconstructing phylogenetic trees. _Molecular Biology
     and Evolution_, *4*, 406-425.

_S_e_e _A_l_s_o:

     'write.tree', 'read.tree', 'dist.dna'

_E_x_a_m_p_l_e_s:

     ### From Saitou and Nei (1987, Table 1):
     x <- c(7, 8, 11, 13, 16, 13, 17, 5, 8, 10, 13,
            10, 14, 5, 7, 10, 7, 11, 8, 11, 8, 12,
            5, 6, 10, 9, 13, 8)
     M <- matrix(NA, 8, 8)
     M[row(M) > col(M)] <- x
     M[row(M) < col(M)] <- x
     diag(M) <- 0
     rownames(M) <- colnames(M) <- 1:8
     tr <- nj(M)
     plot(tr, "u")
     ### a less theoretical example
     data(woodmouse)
     trw <- nj(dist.dna(woodmouse))
     plot(trw)

