mlnet {mlergm} | R Documentation |
Multilevel Network
Description
Function creates a multilevel network object of class mlnet
. The object inherits the network
class, with additional information concerning the multilevel structure.
Usage
mlnet(network, node_memb, directed = FALSE)
## S3 method for class '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",
...
)
Arguments
network |
Either a |
node_memb |
Vector (length equal to the number of nodes in the network) indicating to which block or group the nodes belong. |
directed |
( |
x |
An object of class |
node_size |
Controls the size of nodes. |
palette |
If package |
memb_colors |
Specifies the named colors to be used for the membership colors. |
arrow.gap |
(Directed graphs only) Controls the amount of space between arrowheads and the nodes. |
arrow.size |
(Directed graphs only) Controls the size of the arrowhead. |
color_legend_title |
Name for the node color legend title. |
legend |
( |
legend.position |
The position of the legend in the plot. Defaults to the "right" position. |
layout_type |
Viable layout options. See |
... |
Additional arguments to be passed to |
Details
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.
Value
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.
Methods (by generic)
-
plot
: Plots network objects of typemlnet
.
Examples
# Show how the sampson dataset can be turned into an mlnet object
data(sampson)
net <- mlnet(samplike, get.vertex.attribute(samplike, "group"))