clusterData-methods        package:Rgraphviz        R Documentation

_G_e_t _a_n_d _s_e_t _a_t_t_r_i_b_u_t_e_s _f_o_r _a _c_l_u_s_t_e_r _o_f _a_n _R_a_g_r_a_p_h _o_b_j_e_c_t

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

     Attributes of a graph can be accessed using 'clusterData'.  
     There's no default attributes for clusters. The attributes must be
     defined using 'graphDataDefaults'.

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

     clusterData(self, cluster, attr)
     clusterData(self, cluster, attr) <- value

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

    self: A 'Ragraph-class' instance

 cluster: cluster number

    attr: A 'character' vector of length one specifying the name of a
          cluster attribute

   value: A 'character' vector to store as the attribute value

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

     Li Long <li.long@isb-sib.ch>

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

     library(graph)
     library(Rgraphviz)

     g1_gz <- gzfile(system.file("GXL/graphExample-01.gxl.gz",package="graph"), open="rb")
     g11_gz <- gzfile(system.file("GXL/graphExample-11.gxl.gz",package="graph"), open="rb")
     g1 <- fromGXL(g1_gz)
     g11 <- fromGXL(g11_gz)
     g1_11 <- join(g1, g11)
     sgl <- vector(mode="list", length=2)
     sgl[[1]] <- list(graph=g1, cluster=TRUE)
     sgl[[2]] <- list(graph=g11, cluster=TRUE)
     ng <- agopenSimple(g1_11, "tmpsg", subGList=sgl)
     clusterData(ng, 1, c("bgcolor")) <- c("blue")
     clusterData(ng, 2, c("bgcolor")) <- c("red")
     toFile(ng, layoutType="dot", filename="g1_11_dot.ps", fileType="ps")

