Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

clusterData-methods

Get and set attributes for a cluster of an Ragraph object


Description

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

Usage

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

Arguments

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

Author(s)

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

Examples

g1_gz <- gzfile(system.file("GXL/graphExample-01.gxl.gz",
                            package="graph"))
g11_gz <- gzfile(system.file("GXL/graphExample-11.gxl.gz",
                             package="graph"))
if(require(XML)) {
  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")
}

Rgraphviz

Provides plotting capabilities for R graph objects

v2.34.0
EPL
Authors
Kasper Daniel Hansen [cre, aut], Jeff Gentry [aut], Li Long [aut], Robert Gentleman [aut], Seth Falcon [aut], Florian Hahne [aut], Deepayan Sarkar [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.