leaves                 package:graph                 R Documentation

_F_i_n_d _t_h_e _l_e_a_v_e_s _o_f _a _g_r_a_p_h

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

     A leaf of an undirected graph is a node with degree equal to one. 
     A leaf of a directed graph is defined with respect to in-degree or
     out-degree.  The leaves of a directed graph with respect to
     in-degree (out-degree) are those nodes with in-degree (out-degree)
     equal to zero.

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

     leaves(object, degree.dir)

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

  object: A 'graph' object

degree.dir: One of '"in"' or '"out"'.  This argument is ignored when
          'object' is undirected and required otherwise. When
          'degree.dir="in"' ('degree.dir="out"'), nodes have no in
          coming (out going) edges will be returned. 

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

     A character vector giving the node labels of the leaves.

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

     Seth Falcon

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

     data(graphExamples)
     graphExamples[[1]]
     leaves(graphExamples[[1]])

     data(apopGraph)
     leaves(apopGraph, "in")
     leaves(apopGraph, "out")

