multigraph {multigraph}R Documentation

Multigraphs and valued multigraphs

Description

A function to create and manipulate multigraphs and valued multigraphs with different layout options

Usage

multigraph(net, layout = c("circ", "force", "stress", "conc", "rand"), scope, 
           directed=TRUE, loops, signed, valued, values, lbs, showLbs, att, lbat, 
           showAtts, main=NULL, cex.main, col.main, font.main, coord, collRecip, undRecip, 
           seed=NULL, maxiter=100, clu, cex, cex2, pch, lwd, lty, vcol, vcol0, col, ecol, 
           bwd, bwd2, pos, bg, bg2, asp, drp, add, swp, swp2, alpha=c(1, 1, 1, 1), rot, 
           mirrorX, mirrorY, mirrorD, mirrorL, mirrorV, mirrorH, scl, hds, vedist, mar, 
           ffamily, fstyle, fsize, fsize2, fcol, fcol2, lclu, sel, new, mai, lscl, 
           rm.isol, ...)

Arguments

net

an array; usually with three dimensions of stacked matrices where the multiple relations are placed.

layout

the visualization layout:

  • circ circular

  • force force-directed

  • stress stress-majorization

  • conc concentric

  • rand random

scope

(optional) the scope of the graph (see details)

directed

(logical) whether or not the graph is directed or unidrected

loops

(optional, logical, and experimental) plot graph loops?

signed

(optional and logical) whether or not the graph is a signed structure

valued

(optional and logical) whether the graph is depicyed as valued or not

values

(optional and logical) print the values of the bonds in edges?

lbs

(optional) the vertices labels

showLbs

(optional and logical) whether or not show the vertex labels

att

(optional) a vector or an array representing the vertex attributes

lbat

(optional) the labels for the vertices' attributes

showAtts

(optional and logical) whether or not show the vertex attribute labels

main

(optional) title of the plot

cex.main

(optional) the size of the plot's title

col.main

(optional) the color of the plot's title

font.main

(optional) the font of the plot's title

coord

(optional) data frame with the coordinates of the vertices. If coordinates are given then the layout option is ignored

collRecip

(optional and logical) whether or not collapse reciprocated edges in the unidrected graph

undRecip

(optional and logical) whether or not plot reciprocated edges as undirected

seed

(optional) the random seed number for the vertices' initial coordinates. Ignored for circ and conc

maxiter

(optional) the maximum number of iterations in layout algorithms. Only for force, stress, and rand

clu

(optional) the clustering of the vertices (see details)

cex

(optional) the size of the vertices

cex2

the size of the background for the values with the valued option

pch

(optional) the symbol representing the vertices

lwd

(optional) the width of the edges; ignored if valued is set to TRUE

lty

(optional) the shape of the edges

vcol

(optional) the color of the vertices

vcol0

(optional) the color of the vertices' contour (only works for pch 21 through 25

col

(optional) alias for vcol

ecol

(optional) the color of the edges

bwd

(optional) the width of the bundle edges.

bwd2

(optional) the width of the bundle loop edges.

pos

(optional) the position of the vertices' labels (0 means “in middle of vertex”)

bg

(optional) the background color of the plot

bg2

(optional) the background color for values

asp

(optional) the aspect ratio of the plot

drp

(optional) for valued networks, drop values less than the specified

add

(optional) nodes to add to the graph

swp

(optional and logical) whether or not swap the bundle patterns

swp2

(optional and logical) whether or not swap reciprocals

alpha

vector (vertex, edge, bg) with the alpha color transparecy

rot

(optional) clockwise rotation of the graph in degrees

mirrorX

(optional) mirror of the X axis

mirrorY

(optional) mirror of the Y axis

mirrorD

(optional) mirror reflection across diagonal Y=X

mirrorL

(optional) mirror reflection across diagonal Y=-X

mirrorV

same as mirrorX

mirrorH

same as mirrorY

scl

(optional and experimental) numerical scalar (x and y) or vector (x, y) of the graph's scale

hds

(optional and experimental) arcs' head scale

vedist

(optional and experimental) a real number with vertex - edge distance

mar

(optional) the margins of the plot

ffamily

the font family

fstyle

the font style

fsize

the font size

fsize2

the font size for values

fcol

the font color

fcol2

the font color for values

lclu

(optional, vector) “levels” in clu (see details)

sel

(optional, vector) selection of node's labels to plot

new

(optional, logical) new graph on an existing plot?

mai

(optional, vector) plot inner margins

lscl

(optional for valued graphs) loop scale

rm.isol

(optional) remove isolated vertices?

...

Additional argument items (see e.g. par)

Details

Multigraphs are graphs having parallel edges depicting different types of relations in a network. By default, a circular layout is applied where each type of tie has a distinctive shape and gray color scale. For better visualization, undirected multigraphs automatically collapse the reciprocal relations, and there is an argument to prevent this from happening. It is possible to combine the symbols and colors of vertices by assigning a class to each network member in the clustering option. Vertices can also have different sizes by specifying the argument with a vector with a length size similar to the network order.

Since this function can handle a large number of arguments, these can be stored as a list object that is passed through the scope option. In this case, a vector made of lists and scalars or combinations of these is accepted for describing characteristics.

The bundle width specified by bwd (and bwd2 for loops) ranges from 0 (edges collapsed) to the default 1 (depending on the vertices' size). For the valued option, numbers higher than one are possible. Use vedist to adjust vertex–edge distance for large and dense networks.

In some cases, such as when working with dynamic networks, it is needed to specify the ordering of the “levels” of the clustering information given in clu, and this is done in argument lclu.

When using new for plotting the graph with a background image, the previous plot(s), however, can require having an equivalent command to graphics::plot.new() (cf. e.g. sdam::plot.map() function).

Value

A plot of the network as a multigraph or a valued multigraph.

Author(s)

Antonio Rivero Ostoic

See Also

bmgraph, ccgraph, frcd, stsm, conc

Examples

## Create the data: two binary relations among three elements
arr <- round( replace( array(runif(18), c(3,3,2)), array(runif(18),
       c(3,3,2))>.5, 3 ) )

## Plot the multigraph of this network
multigraph(arr)

## Now with a force directed algorithm
multigraph(arr, layout = "force")

## As weighted graph
multigraph(arr, weighted = TRUE)

## As signed graph
multigraph(arr, signed = TRUE)

## With loops and a costumized vertex size
multigraph(arr, cex = 3, loops = TRUE)


[Package multigraph version 0.99-3 Index]