components                package:sna                R Documentation

_F_i_n_d _t_h_e _N_u_m_b_e_r _o_f (_M_a_x_i_m_a_l) _C_o_m_p_o_n_e_n_t_s _W_i_t_h_i_n _a _G_i_v_e_n _G_r_a_p_h

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

     Returns the number of components within 'dat', using the
     connectedness rule given in 'connected'.

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

     components(dat, connected="strong", comp.dist.precomp=NULL)

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

     dat: one or more input graphs. 

connected: the the component definition to be used by 'component.dist'
          during component extraction. 

comp.dist.precomp: a component size distribution object from
          'component.dist' (optional). 

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

     The 'connected' parameter corresponds to the 'rule' parameter of
     'component.dist'.  By default, 'components' returns the number of
     strong components, but other component types can be returned if so
     desired.  (See 'component.dist' for details.)  For symmetric
     matrices, this is obviously a moot point.

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

     A vector containing the number of components for each graph in
     'dat'

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

     Carter T. Butts buttsc@uci.edu

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

     West, D.B.  (1996).  _Introduction to Graph Theory_.  Upper Saddle
     River, NJ: Prentice Hall.

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

     'component.dist', 'symmetrize'

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

     g<-rgraph(20,tprob=0.05)   #Generate a sparse random graph

     #Find weak components
     components(g,connected="weak")

     #Find strong components
     components(g,connected="strong")

