Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Directionality

Controlling edge directionality


Description

Functions to get and set the edge directionality of one or more pairs of layers (that is, the directionality of edges connecting nodes in those layers).

Usage

set_directed_ml(n, directionalities)
is_directed_ml(n, layers1 = character(0), layers2 = character(0))

Arguments

n

A multilayer network.

directionalities

A dataframe with three columns where each row contains a pair of layers (l1,l2) and 0 or 1 (indicating resp. undirected and directed edges). Directionality is automatically set for both (l1,l2) and (l2,l1).

layers1

The layer(s) from where the edges start. If layers1 is not provided, all layers are considered.

layers2

The layer(s) where the edges end. If an empty list of layers is passed (default), the ending layers are set as equal to those in parameter layers1.

Value

is_directed_ml returns a data frame where each row contains the name of two layers and the corresponding type of edges (directed/undirected).

See Also

Examples

net <- ml_empty()
# Adding some layers, one directed and one undirected
add_layers_ml(net,c("l1","l2"),c(TRUE,FALSE))
# Setting the directionality of inter-layer edges
layers = c("l1","l2")
dir <- data.frame(layers,layers,c(0,1))
set_directed_ml(net,dir)
# retrieving all directionalities
dir <- is_directed_ml(net)
# copying directionalities to a new network
net2 <- ml_empty()
add_layers_ml(net2,c("l1","l2"))
set_directed_ml(net2,dir)

multinet

Analysis and Mining of Multilayer Social Networks

v3.3.2
GPL
Authors
Matteo Magnani, Luca Rossi (API design), Obaida Hanteer (mdlpa, flat_ec, flat_nw, some community eval. functions), Davide Vega (API and code design), Mikael Dubik (glouvain). The package uses functions from eclat (www.borgelt.net/eclat.html), for association rule mining, Eigen (eigen.tuxfamily.org) and spectra (https://spectralib.org), for matrix manipulation, Infomap (www.mapequation.org), for the Infomap community detection method, and Howard Hinnant's date and time library (https://github.com/HowardHinnant/date). The code from these libraries has been included in our source package.
Initial release
2021-01-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.