Function creates a multilevel network object of class mlnet
. The object inherits the network
class, with additional information concerning the multilevel structure.
mlnet(network, node_memb, directed = FALSE)# S3 method for mlnet
plot(x, node_size = 2.5, palette = NULL,
memb_colors = NULL, arrow.gap = 0.015, arrow.size = 4,
color_legend_title = "", legend = TRUE, legend.position = "right",
layout_type = "kamadakawai", ...)
Either a network
object, an adjacency matrix, or an edge list.
Vector (length equal to the number of nodes in the network) indicating to which block or group the nodes belong.
(TRUE
or FALSE
) Indicates whether the supplied network is directed or undirected. Default is FALSE
.
An object of class mlnet
, possibly produced by mlnet
or simulate_mlnet
.
Controls the size of nodes.
If package RColorBrewer
is installed, then the name of an R color brewer pallete can be specified and used for the block colors. See brewer.pal
for details on RColorBrewer palletes.
Specifies the named colors to be used for the membership colors.
(Directed graphs only) Controls the amount of space between arrowheads and the nodes.
(Directed graphs only) Controls the size of the arrowhead.
Name for the node color legend title.
(TRUE
or FALSE
) Controls whether the block membership legend is printed.
The position of the legend in the plot. Defaults to the "right" position.
Viable layout options. See gplot.layout
for options.
Additional arguments to be passed to ggnet2
.
mlnet
returns an object of class mlnet
which inherits the network
class, with the additional vector attribute node_memb
, which encodes the block membership of the multilevel netwrok.
plot
: Plots network objects of type mlnet
.
The mlnet
function creates an object of class mlnet
which is used to access methods designed specifically for multilevel networks, including visualization methods as well as direct interface with some of the main functions, such as mlergm
. Presently, the mlnet
function and object class cover multilevel structure where the set of nodes is nested within known block structure.
# NOT RUN {
# Show how the sampson dataset can be turned into an mlnet object
data(sampson)
net <- mlnet(samplike, get.vertex.attribute(samplike, "group"))
# }
Run the code above in your browser using DataLab