Learn R Programming

mixer (version 0.2)

Gplot: Graph Plot

Description

This graph-drawing function is based on low-level routines which have been extracted from the sna package (mainly gplot) and reorganized to exploit more conveniently its possibilies in the mixer context.

mixer graphs have real-valued undirected edges, have coloured vertices, and don't have self-loops. Graphical options have been chosen to try to be more illustrative for gene regulation networks .

Usage

Gplot( X, cl = NULL, ...     )

Arguments

X
Adjacency matrix or edge list ( matrix(2,N) ).
cl
node classification vector. Default NULL.
...
Additional optional arguments are available, see details section.

Value

  • A matrix of node coordinates is returned, along with a plotted graph.

Details

This function basically adapts the given precision matrix (and optional node classification vector) and creates a graph which is plotted using low-level functions extracted from from the sna package function (gplot).

Given the frame of our work, the graph is undirected, real-valued, with no self-loops. Edges are coloured by edge weight sign (red for negative partial correlation, blue for positive). Edge widths are proportional to absolute edge weight, the maximal width being set to 5. Additionally, weak edges are dotted rather than solid. The function returns the coordinates of the nodes in the plot, which can be later passed back to Gplot, effectively skipping the coordinate calculation phase.

Additional arguments are : [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

See Also

mixer, sna, gplot, plot

Examples

Run this code
# Generate a graph
  g <- graph.affiliation(n=100,c(1/3,1/3,1/3),0.8,0.2)

  # Display adjacency matrix
  Gplot(g$x, g$cluster)

  # Read a new graph
  data(blog)
  Gplot( as.matrix( blog$link ), blog$politicalParty)

Run the code above in your browser using DataLab