mlergm (version 0.1)

mlnet: 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 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 network object, an adjacency matrix, or an edge list.

node_memb

Vector (length equal to the number of nodes in the network) indicating to which block or group the nodes belong.

directed

(TRUE or FALSE) Indicates whether the supplied network is directed or undirected. Default is FALSE.

x

An object of class mlnet, possibly produced by mlnet or simulate_mlnet.

node_size

Controls the size of nodes.

palette

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.

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

(TRUE or FALSE) Controls whether the block membership legend is printed.

legend.position

The position of the legend in the plot. Defaults to the "right" position.

layout_type

Viable layout options. See gplot.layout for options.

Additional arguments to be passed to ggnet2.

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 type mlnet.

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.

Examples

Run this code
# 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