Gplot {mixer} | R Documentation |
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 .
Gplot( X, cl = NULL, ... )
X |
Adjacency matrix or edge list ( matrix(2,N) ). |
cl |
node classification vector.
Default NULL .
|
... |
Additional optional arguments are available, see details section. |
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 :
cols
NULL
.
coord
matrix
containing the 2D coordinates for the nodes (one node per row). Default NULL
.
my.labels
vector
: Labels for the nodes. Default NULL
.
display.labels
FALSE
.
degree.threshold
.Machine$double.xmin
.
max.edges
10000
.
main
, sub
plot
arguments. Default "Gplot"
and NULL
respectively.
A matrix of node coordinates is returned, along with a plotted graph.
A. Smith and G. Grasseau
# Generate a graph g <- graph.affiliation(n=100,c(1/3,1/3,1/3),0.8,0.2) # Display adjacency matrix ## Not run: Gplot(g$x, g$cluster) # Read a new graph data(blog) ## Not run: Gplot( as.matrix( blog$link ), blog$politicalParty)