Ragraph-class {Rgraphviz} | R Documentation

## Class "Ragraph": A class to handle libgraph representations

### Description

Class `Ragraph` is used to handle libgraph representations of R graph objects.

### Objects from the Class

Objects can be created by calls to the function `agopen`.

### Slots

`agraph`:

  Object of class `"externalptr"`: A C based structure containing the libgraph information

`laidout`:

  Object of class `"logical"`: Whether or not this graph has been laid out or not.

`layoutType`:

  Object of class `"character"`: The layout method used for this object

`edgemode`:

  Object of class `"character"`: The edgemode for this graph - “directed” or “undirected”

`AgNode`:

  Object of class `"list"`: A list of `AgNode` objects.

`AgEdge`:

  Object of class `"list"`: A list of `AgEdge` objects.

`boundBox`:

  Object of class `"boundBox"`: Defines the bounding box of the plot.

`bg`:

  Object of class `"character"`: The background color.

`fg`:

  Object of class `"character"`: The foreground color.

### Methods

show

  `signature(object = "Ragraph")`: A brief summary of the contents

agraph

  `signature(object = "Ragraph")`: Returns the external libgraph pointer

laidout

  `signature(object = "Ragraph")`: Returns the `laidout` slot

boundBox

  `signature(object = "Ragraph")`: Returns the bounding box.

AgEdge

  `signature(object = "Ragraph")`: Returns the edge list.

AgNode

  `signature(object = "Ragraph")`: Returns the node list.

edgemode

  `signature(object = "Ragraph")`: Retrieves the edgemode of this object.

layoutType

  `signature(object = "Ragraph")`: Retrieves the method used for the layout of this graph.

edgeNames

  `signature(object = "Ragraph")`: Returns a vector of the names of the edges in this graph.

graphDataDefaults

  `signature(self= "Ragraph")`: Gets default attributes of the given graph.

graphDataDefaults<-

  `signature(self= "Ragraph", attr="vector", value="vector")`: Sets default attributes of the given graph.

graphData

  `signature(self= "Ragraph", attr="vector")`: Gets attributes of the given graph.

graphData<-

  `signature(self= "Ragraph", attr="vector", value="vector")`: Sets attributes of the given graph.

clusterData

  `signature(self= "Ragraph", cluster="numeric", attr="vector")`: Gets attributes of a cluster for the given graph.

clusterData<-

  `signature(self= "Ragraph", cluster="numeric", attr="vector", value="vector")`: Sets attributes of a cluster for the given graph.

edgeDataDefaults

  `signature(self= "Ragraph",attr="missing")`: Gets default attributes of the given edge.

edgeDataDefaults<-

  `signature(self= "Ragraph", attr="vector", value="vector")`: Sets default attributes of the given edge.

edgeData

  `signature(self= "Ragraph", from="vector", to="vector", attr="vector")`: Gets attributes of the given edge.

edgeData<-

  `signature(self= "Ragraph", from="vector", to="vector", attr="vector", value="vector")`: Sets attributes of the given edge.

nodeDataDefaults

  `signature(self= "Ragraph",attr="missing")`: Gets default attributes of the given node.

nodeDataDefaults<-

  `signature(self= "Ragraph", attr="vector", value="vector")`: Sets default attributes of the given node.

nodeData

  `signature(self= "Ragraph", n="vector", attr="vector")`: Gets attributes of the given node.

nodeData<-

  `signature(self= "Ragraph", n="vector", attr="vector", value="vector")`: Sets attributes of the given node.

getNodeXY

  `signature(object = "Ragraph")`: Returns a two element list, the first element contains a numerical vector with the 'x' positions of every node in this graph, and the second element contains a numerical vector with the 'y' positions for every node in the graph.

getNodeHeight

  `signature(object = "Ragraph")`: Returns a vector with the heights of every node in the graph

getNodeLW

  `signature(object = "Ragraph")`: Returns a vector with the left width of every node in the graph.

getNodeRW

  `signature(object = "Ragraph")`: Returns a vector with the right width of every node in the graph.

### Author(s)

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

### See Also

`agopen`

### Examples

    set.seed(123)
    V <- letters[1:10]
    M <- 1:4
    g1 <- randomGraph(V, M, .2)
    z <- agopen(g1,"foo")
    z

    ## The various methods in action

    ## These methods are all used to obtain positional information about nodes
    getNodeXY(z)
    getNodeHeight(z)
    getNodeLW(z)
    getNodeRW(z)

    ## Retrieve information about the edges in the graph
    edgeNames(z)
    edgemode(z)

    ## These get information about the layout
    laidout(z)
    layoutType(z)
    boundBox(z)

    ## Used to retrieve the entire list of edges or nodes
    AgEdge(z)
    AgNode(z)

[Package Rgraphviz version 2.34.0 Index]