plot_mnet: Visualize a multi-level network (using ggraph)

Description Usage Arguments Details Value Examples

View source: R/visualize_mnet.R

Description

Visualize a multi-level network, with the possibility of specifying separate layouts for each level. This is a somewhat hacky wrapper for arranging separate ggraph calls for each network level in a circle.

Usage

1
2
3
4
5
6
7
8
9
plot_mnet(
  net,
  lvl_attr = c("sesType"),
  layouts = rep("kk", n_levels),
  label = FALSE,
  directed = NULL,
  nodesize = 3,
  edgewidth = 0.5
)

Arguments

net

A tidygraph, igraph or statnet network object

lvl_attr

The name of the categorical node attribute specifying at which level a node is situated

layouts

A list of layouts (see ggraph::layout_ggraph) for every level e.g. for two levels list("auto","circle")

label

logical - should nodes be labelled? (defaults to false)

directed

whether the network object shall be interpreted as directed network. Per default, motifr::is.directed is used to determine that.

nodesize

The size of node displays, if displayed as points (if label = false)

edgewidth

The width of lines illustrating edges

Details

For more extensive visualization options, it is recommended to explore the layout_as_multilevel function included in the package graphlayouts.

Value

A ggraph object

Examples

1
plot_mnet(net = motifr::ml_net, lvl_attr = "sesType", layouts = list("kk", "circle"))

motifr documentation built on Dec. 15, 2020, 5:23 p.m.