bmgraph {multigraph}R Documentation

Bipartite multigraph

Description

A function to create and manipulate bipartite multigraphs

Usage

bmgraph(net, layout = c("bip", "bip3", "bip3e", "bipc", "force", "rand", "circ", 
       "stress", "CA", "circ2"), scope, coord, alpha = c(1, 1, 1), showLbs, showAtts, 
       att = NULL, lbat = "1", main = NULL, cex.main, bg, mar, directed, valued, 
       collRecip, cex, pos, lwd, lty, col, ecol, vcol, vcol0, asp, seed = NULL, 
       maxiter = 100, bwd, clu, pch, rot, mirrorX, mirrorY, mirrorV, mirrorH, hds, 
       vedist, jitter, sort, add, adc, perm, ffamily, fstyle, fsize, fcol, vclu, ...)

Arguments

net

data frame or array representing the two-mode network (see details)

layout

the visualization layout:

  • bip (default) bipartite graph

  • bip3 bipartite graph with three columns

  • bip3e bipartite graph with three columns for events

  • bipc “clustered” bipartite graph

  • force force-directed algorithm

  • rand random

  • circ circular

  • stress stress-majorization algorithm

  • CA correspondence analysis

  • circ2 two semi-circles

scope

(optional) scope of the graph (see details)

coord

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

alpha

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

showLbs

(optional and logical) whether or not to show the vertex labels when dimnames available

showAtts

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

att

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

lbat

(optional) labels for the vertex attributes

main

(optional) title of the plot

cex.main

(optional) size of the plot's title

bg

(optional) background color of the plot

mar

(optional) margins of the plot

directed

(optional and logical) whether or not the graph is directed or undirected

valued

(optional and logical) whether or not the graph is valued or with dichotomous data

collRecip

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

cex

(optional) size of the vertices

pos

(optional) position of the vertices' labels (0 means “at the center of the vertex”)

lwd

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

lty

(optional) shape of the edges

col

(optional) alias for vcol

ecol

(optional) color of the edges

vcol

(optional) color of the vertices

vcol0

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

asp

(optional) aspect ratio of the plot

seed

(optional) random seed number for the vertices' initial coordinates. Ignored except for force, stress and rand

maxiter

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

bwd

(optional) width of the bundle edges: ranges from 0 (edges collapsed) to the default 1 (depending on the vertices' size), and for valued a value greater than one is possible

clu

(optional) clustering of the vertices (see details)

pch

(optional) symbol representing the vertices

rot

(optional) clockwise rotation of the graph in degrees

mirrorX

(optional) mirror of the X axis

mirrorY

(optional) mirror of the Y axis

mirrorV

same as mirrorX

mirrorH

same as mirrorY

hds

(optional and experimental) arcs' head scale

vedist

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

jitter

(optional) jitter in stress or CA

sort

(optional and logical) sort the vertex labels

add

(optional) add nodes to the graph's domain

adc

(optional) add nodes to the graph's codomain

perm

(optional) a list of vectors for the permutation of network members in both the domain and codomain

ffamily

(optional) font family

fstyle

(optional) font style

fsize

(optional) font size

fcol

(optional) font color

vclu

(optional) clustering information in both the domain and the codomain in a list of vectors with integers or NULL (see details)

...

Additional argument items (see e.g. par)

Details

Bipartite graphs serve as visual aids for two-mode networks. While these networks are typically represented as data frames, they can also be visualized using three-dimensional arrays, where each level corresponds to a specific type of connection, resulting in parallel edges within the bipartite graph. Additionally, a bipartite network can be generated using a force-directed algorithm to create a visual representation.

With bipartite graphs consisting of two sets of vertices, clustering information, such as vertex colors, can be stored in a list vclu with two vectors, one for each vertex set. It is possible to group all members of a vertex set into a single class by setting the corresponding vector to NULL.

Value

A plot of the two-mode network as a bipartite graph or multigraph with a projection

Author(s)

Antonio Rivero Ostoic

See Also

multigraph, frcd, stsm, conc

Examples

## 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 ) )

## network as bipartite graph
bmgraph(arr)

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

## with a Correspondence Analysis method
bmgraph(arr, layout = "CA", asp = NA)


[Package multigraph version 0.99-3 Index]