addNode                package:graph                R Documentation

_a_d_d_N_o_d_e

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

     Add a node to a graph.

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

     addNode(node, object)

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

    node: a character string, or node object 

  object: a 'graph' 

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

     The supplied node is added to the set of nodes of the 'object'.

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

     A new graph of the same class as 'object' with the supplied node
     added to the set of nodes.

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

     R. Gentleman

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

     'removeNode', 'removeEdge', 'addEdge'

_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 <- addNode("X", gR)

