graphAM-class             package:graph             R Documentation

_C_l_a_s_s "_g_r_a_p_h_A_M"

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

     A graph class where node and edge information is represented as an
     adjacency matrix.  The adjacency matrix is square and element
     'adjMat[i, j]' is one if there is an edge from node i to node j
     and zero otherwise.

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

     The non-zero matrix values can be used to initialize an edge
     attribute.  If this is desired, use the 'values' argument in the
     call to 'new' and provide a list with a single named element. The
     name determines the attributes and the value provides the default
     value for that attribute.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("graphAM",
     adjMat, edgemode, values)'.

_S_l_o_t_s:


     '_a_d_j_M_a_t': An adjacency '"matrix"' describing the graph structure. 
          The 'colnames' of the matrix will be used as node names for
          the graph if present.

     '_e_d_g_e_m_o_d_e': A '"character"' vector specifying whether the graph is
          "directed" or "undirected".

     '_e_d_g_e_D_a_t_a': Storage for edge attributes.

     '_n_o_d_e_D_a_t_a': Storage for node attributes.

_E_x_t_e_n_d_s:

     Class '"graph"', directly.

_M_e_t_h_o_d_s:


     _a_d_d_E_d_g_e 'signature(from = "character", to = "character", graph =
          "graphAM", weights = "missing")': ... 

     _a_d_d_N_o_d_e 'signature(object = "graphAM", nodes = "character")': ... 

     _c_l_e_a_r_N_o_d_e 'signature(node = "character", object = "graphAM")': ... 

     _c_o_e_r_c_e 'signature(from = "graphAM", to = "graphNEL")': ... 

     _c_o_e_r_c_e 'signature(from = "graphAM", to = "matrix")': In converting
          to a 'matrix', if an edge attribute named '"weight"' is
          defined, the non-zero elements of the matrix will contain the
          corresponding attribute value.  For more flexible matrix
          conversion, see 'toMatrix'.

     _c_o_e_r_c_e 'signature(from = "matrix", to = "graphAM")': This coerce
          method exists for symmetry.  In most cases, creating a new
          'graphAM' instance using 'new' gives one more control over
          the resulting graph.

     _e_d_g_e_s 'signature(object = "graphAM", which = "missing")': ... 

     _e_d_g_e_s 'signature(object = "graphAM", which = "character")': ... 

     _i_n_i_t_i_a_l_i_z_e 'signature(.Object = "graphAM")': ... 

     _i_n_E_d_g_e_s 'signature(node = "character", object = "graphNEL")':
          Return the incoming edges for the specified nodes.  See
          'inEdges'.

     _i_s_A_d_j_a_c_e_n_t 'signature(object = "graphAM", from = "character", to =
          "character")': ... 

     _n_o_d_e_s<- 'signature(object = "graphAM", value = "character")': ... 

     _n_o_d_e_s 'signature(object = "graphAM")': ... 

     _n_u_m_E_d_g_e_s 'signature(graph = "graphAM")': ... 

     _n_u_m_N_o_d_e_s 'signature(object = "graphAM")': ... 

     _r_e_m_o_v_e_E_d_g_e 'signature(from = "character", to = "character", graph
          = "graphAM")': ... 

     _r_e_m_o_v_e_N_o_d_e 'signature(node = "character", object = "graphAM")':
          ... 

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

     Seth Falcon

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

     'graph-class', 'graphNEL-class'

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

     mat <- rbind(c(0, 0, 1, 1),
                  c(0, 0, 1, 1),
                  c(1, 1, 0, 1),
                  c(1, 1, 1, 0))
     rownames(mat) <- colnames(mat) <- letters[1:4]
     g1 <- new("graphAM", adjMat=mat)
     stopifnot(identical(mat, as(g1, "matrix")), validObject(g1))

     ## now with weights:
     mat[1,3] <- mat[3,1] <- 10
     gw <- new("graphAM", adjMat=mat, values=list(weight=1))

     ## consistency check:
     stopifnot(identical(mat, as(gw, "matrix")),
               validObject(gw),
               identical(gw, as(as(gw, "graphNEL"), "graphAM")))

