Learn R Programming

simone (version 0.1-3)

Gplot: 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.

Value

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

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 : [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

See Also

SimDataAffiliation, Mplot

Examples

Run this code
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")

Run the code above in your browser using DataLab