subGraph                package:graph                R Documentation

_C_r_e_a_t_e _a _S_u_b_g_r_a_p_h

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

     Given a set of nodes and a graph this function creates and returns
     subgraph with only the supplied nodes and any edges between them.

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

     subGraph(snodes, graph)

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

  snodes: A 'character' vector of node labels. 

   graph: A graph object, it must inherit from the 'graph' class. 

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

     The returned subgraph is a copy of the graph. Implementations for
     Implementations for 'graphNEL', 'distGraph' and 'clusterGraph'.

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

     A graph of the same class as the 'graph' argument but with only
     the supplied nodes.

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

     R. Gentleman

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

     'nodes','edges'

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

             set.seed(123)
             x <- rnorm(26)
             names(x) <- letters
             library(stats)
             d1 <- dist(x)
             g1 <- new("distGraph", Dist=d1)
             subGraph(letters[1:5], g1)

