Gplot {simone}R Documentation

Graph Plot

Description

This function plots a graph representation from its adjacency matrix using when available a classification vector describing a partition of the nodes. .

Usage

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

Arguments

A graph adjacency matrix.
cl node classification vector. Default NULL.
... Additional optional arguments are available, see details.

Details

This graph-drawing function is based on C routines extracted from the sna package and reorganized to adapt its possibilities in our framework (graphs are undirected, weighted and with no self-loops).

Edges are coloured by sign (red for negative, blue for positive). Edge widths are proportional to absolute edge weight, the maximal width being set to 5. Weak edges are dotted rather than solid. The function returns the coordinates of the nodes which can be later passed back to Gplot.

Additional arguments are :

coord
A Matrix containing the 2D coordinates for the nodes (one node per row). Default NULL.
labels
A character vector containing the labels of the nodes. Default NULL.
main, sub
Graphical options corresponding to generic function plot arguments. Defaults NULL.
degree.threshold
Threshold under which edges are not plotted. Default .Machine$double.xmin.
display.isolate
Boolean to display the isolated nodes. Default TRUE.
cols
Colour specification for each node cluster.
max.edges
Maximal number of edges over which the graph will not be plot. Default 10000.

Value

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

Author(s)

G. Grasseau, A. Smith and J. Chiquet

See Also

SimDataAffiliation, Mplot

Examples

  library(simone)

  ## Graph generation
  p <- 100
  n <- 1
  proba.in  <- 0.15
  proba.out <- 0.005
  alpha <- c(.5,.3,.2)
  X <- SimDataAffiliation (p, n, proba.in, proba.out, alpha)

  ## Graphical representation
  g <- Gplot(X$K.theo, X$cl.theo, main = "A tri-modular graph")

[Package simone version 0.1-2 Index]