Graph Components            package:spdep            R Documentation

_D_e_p_t_h _F_i_r_s_t _S_e_a_r_c_h _o_n _N_e_i_g_h_b_o_r _L_i_s_t_s

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

     'n.comp.nb()' finds the number of disjoint connected subgraphs in
     the graph depicted by 'nb.obj' - a spatial neighbours list object.

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

     n.comp.nb(nb.obj)

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

  nb.obj: a neighbours list object of class 'nb'

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

     A list of: 

      nc: number of disjoint connected subgraphs

 comp.id: vector with the indices of the disjoint connected subgraphs
          that the nodes in 'nb.obj' belong to

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

     Nicholas Lewin-Koh kohnicho@comp.nus.edu.sg

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

     'plot.nb'

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

     data(columbus)
     plot(col.gal.nb, coords, col="grey")
     col2 <- droplinks(col.gal.nb, 21)
     plot(col2, coords, add=TRUE)
     res <- n.comp.nb(col2)
     table(res$comp.id)
     points(coords, col=res$comp.id, pch=16)

