edgeWeights              package:graph              R Documentation

_R_e_t_r_i_e_v_e _t_h_e _e_d_g_e _w_e_i_g_h_t_s _f_o_r _s_p_e_c_i_f_i_e_d _i_n_d_i_c_e_s.

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

     Obtains the weights for all edges from the nodes specified by
     'index'.

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

     edgeWeights(object, index)

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

  object: A graph, any object that inherits from the 'graph' class.

   index: If supplied either a numeric vector or a vector of node
          names. 

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

     If 'index' is suppled then edge weights from these nodes to all
     adjacent nodes are found and returned. If 'index' is not supplied
     then the edge weights for all nodes are returned.

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

     A list of named edge weight vectors. The names are index offsets
     into the set of 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:

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

