A function to create and manipulate bipartite multigraphs
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, weighted,
collRecip, cex, pos, lwd, lty, col, ecol, vcol, vcol0, asp, seed = NULL,
maxiter = 100, bwd, clu, pch, fcol, rot, mirrorX, mirrorY, mirrorV, mirrorH,
hds, vedist, jitter, sort, add, adc, cluc, perm, ffamily, fstyle, fsize, ...)
data frame or array representing the two-mode network (see details)
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
(optional) the scope of the graph (see details)
(optional) data frame with the coordinates of the vertices. If coordinates are given then the layout
option is ignored
vector (vertex, edge, bg
) with the alpha color transparecy
(optional and logical) whether or not show the vertex labels when dimnames available
(optional and logical) whether or not show the vertex attribute labels
(optional) a vector or an array representing the vertex attributes
(optional) the labels for the vertex attributes
(optional) title of the plot
(optional) the size of the plot's title
(optional) the background color of the plot
(optional) the margins of the plot
(optional and logical) whether or not the graph is directed or unidrected
(optional and logical) whether or not the graph is weighted or dichotomous
(optional and logical) whether or not collapse reciprocated edges in the unidrected graph
(optional) the size of the vertices
(optional) the position of the vertices' labels (0
means ``at the center of the vertex'')
(optional) the width of the edges. Ignored if weighted
is set to TRUE
(optional) the shape of the edges
(optional) alias for vcol
(optional) the color of the edges
(optional) the color of the vertices
(optional) the color of the vertices' contour (only works for pch 21
through 25
(optional) the aspect ratio of the plot
(optional) the random seed number for the vertices' initial coordinates. Ignored except for force
, stress
and rand
(optional) the maximum number of iterations in layout algorithms. Ignored except for force
, stress
and rand
(optional) the width of the bundle edges. Ranges from 0
(edges collapsed) to the default 1
(depending on the vertices' size). For weighted
a value greater than one is possible
(optional) the clustering of the vertices (see details)
(optional) the symbol representing the vertices
the font color
(optional) clockwise rotation of the graph in degrees
(optional) mirror of the X axis
(optional) mirror of the Y axis
same as mirrorX
same as mirrorY
(optional and experimental) arcs' head scale
(optional and experimental) a real number with vertex - edge distance
(optional) the jitter in stress
or CA
(optional and logical) sort the vertex labels
add nodes to the graph's domain
add nodes to the graph's codomain
a list of vectors the clustering information in both the domain and the codomain
(optional) a list of vectors for the permutation of network members in both the domain and codomain
the font family
the font style
the font size
Additional argument items (see e.g. par
)
A plot of the two-mode networks as bipartite graph or multigraph
Bipartite graphs are visualization devices for two-mode networks. Although this type of data would typically record as a data frame, it is possible to use even three dimensional arrays where each level corresponds to a particular type of tie, and thus the bipartite graphs in this case will be depicted with parallel edges. Besides, it is possible to obtain a graph of the bipartite network using the binomial approach to two-mode data, and plot it with a forced directed algorithm.
multigraph
, frcd
, stsm
, conc
# NOT RUN {
## 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 this network as Bipartite graph
bmgraph(arr)
## Now with a Force Directed algorithm
bmgraph(arr, layout = "force")
## And with a Correspondence Analysis method
bmgraph(arr, layout = "CA", asp = NA)
# }
Run the code above in your browser using DataLab