removeEdge               package:graph               R Documentation

_r_e_m_o_v_e_E_d_g_e

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

     A function to remove the specified edges from a graph.

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

     removeEdge(from, to, graph)

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

    from: from edge labels 

      to: to edge labels

   graph: a 'graph' object 

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

     A new graph instance is returned with the edges specified by
     corresponding elements of the 'from' and 'to' vectors removed.  If
     'from' and 'to' are not the same length, one of them should have
     length one.  All edges to be removed must exist in 'graph'.

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

     A new instance of a graph with the same class as 'graph' is
     returned with the specified edges removed.

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

     R. Gentleman

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

     'addNode','addEdge','removeNode'

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

       V <- LETTERS[1:4]
       edL1 <- vector("list", length=4)
       names(edL1) <- V
       for(i in 1:4)
         edL1[[i]] <- list(edges=c(2,1,4,3)[i], weights=sqrt(i))
       gR <- new("graphNEL", nodes=V, edgeL=edL1)

       gX <- removeEdge("A", "B", gR)

       set.seed(123)
       g <- randomEGraph(V=letters[1:5],edges=5)
       g2 <- removeEdge(from=c("a","b"), to=c("d","c"), g)

