A function to create and manipulate multilevel graphs
mlgraph(net, layout = c("circ", "force", "stress", "rand", "conc", "bip"), main = NULL,
seed = NULL, maxiter = 100, directed = TRUE, alpha = c(1, 1, 1), scope, collRecip,
undRecip, showLbs, showAtts, cex.main, coord, clu, cex, lwd, pch, lty, bwd, bwd2,
att, bg, mar, pos, asp, ecol, vcol, vcol0, col, lbat, swp, loops, swp2, mirrorX,
mirrorY, mirrorD, mirrorL, lbs, mirrorV, mirrorH, rot, hds, scl, vedist, ffamily,
fstyle, fsize, fcol, valued, modes, elv, lng, nr, ...)
A plot of the multilevel graph structure for the network
a "Multilevel"
class object or a three dimensional array with clustering information
the visualization layout:
circ
circular
force
force-directed
stress
stress-majorization
rand
random
conc
concentric
bip
as bipartite graph
(optional) title of the plot
(optional) random seed number for the vertices' initial coordinates. Ignored except for force
, stress
and rand
(optional) maximum number of iterations in layout algorithms. Ignored except for force
, stress
and rand
(logical) whether or not the graph is directed or undirected
vector (vertex, edge, bg
) with the alpha color transparency
(optional) scope of the graph (see details)
(optional and logical) whether or not collapse reciprocated edges in the undirected graph
(optional and logical) whether or not plot reciprocated edges as undirected
(optional and logical) whether or not to show the vertex labels
(optional and logical) whether or not to show the vertex attribute labels
(optional) size of the plot's title
(optional) data frame with the coordinates of the vertices. If coordinates are given then the layout
option is ignored
(optional) clustering of the vertices as a list of vectors with integers or NULL (see details)
(optional) size of the vertices
(optional) width of the edges; ignored if valued
is set to TRUE
(optional) symbol representing the vertices
(optional) shape of the edges
(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
(optional) width of the bundle loop edges.
(optional) a vector or an array representing the vertex attributes
(optional) background color of the plot
(optional) margins of the plot
(optional) position of the vertices' labels (0
means ``at the center of the vertex'')
(optional) aspect ratio of the plot
(optional) color of the edges
(optional) color of the vertices
(optional) color of the vertices' contour (only works for pch 21
through 25
(optional) alias for vcol
(optional) labels for the vertex attributes
(optional and logical) whether or not to swap the bundle patterns
(optional, logical, and experimental) plot graph loops?
(optional and logical) whether or not to swap reciprocals
(optional) mirror of the \(X\) axis
(optional) mirror of the \(Y\) axis
(optional) mirror reflection across diagonal \(Y=X\)
(optional) mirror reflection across diagonal \(Y=-X\)
(optional) vertex labels
same as mirrorX
same as mirrorY
(optional) clockwise rotation of the graph in degrees
(optional and experimental) arcs' head scale
(optional and experimental) numerical scalar (\(x\) and \(y\)) or vector (\(x\), \(y\)) of the graph's scale
(optional and experimental) a real number with vertex - edge distance
the font family
the font style
the font size
the font color
(optional and logical) whether the graph is depicyed as valued or not
(optional) a vector indicating which matrices are domains and which codomains (works only with a "Multilevel"
class object)
(experimental) control loops 1
(experimental) control loops 2
integer or NULL
with the number of radii for conc
layout (see details)
Additional argument items (see e.g. par
)
Antonio Rivero Ostoic
Multilevel graphs serve to represent networks with different ``levels'' such as different domains in the network structure. A characteristic of multilevel networks is the existence of ties within and across domains.
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.
The bundle width specified by bwd
and bwd2
ranges from 0
(edges collapsed) to the default 1
(depending on the vertices' size).
For the valued
option, a number greater than one is possible.
In a multilevel structure, argument clu
is to class network members
and it is possible to class all members of the domain or co-domain into a single class by setting the vector to NULL
.
Similarly, NULL
in argument nr
for the conc
layout implies the use of two radii, one for each domain.
mlvl
, multigraph
, bmgraph
, frcd
, stsm
, conc
## Not run:
# create network data as arrays
arr <- round( replace( array(runif(18), c(3,3,2)), array(runif(18),
c(3,3,2))>.5, 3 ) )
arr2 <- round( replace( array(runif(18), c(3,3,2)), array(runif(18),
c(3,3,2))>.5, 3 ) )
# create multilevel class object and plot multilevel graph
require(multiplex)
mlvl(arr, arr2) |>
mlgraph()
## End(**Not run**)
Run the code above in your browser using DataLab