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

Properties

Listing network properties


Description

These functions are used to list basic information about the components of a multilayer network (actors, layers, vertices and edges).

The functions nodes_ml and num_nodes_ml are deprecated in the current version of the library. The names vertex/vertices are now preferentially used over node/nodes.

Usage

layers_ml(n)
actors_ml(n, layers = character(0))
vertices_ml(n, layers = character(0))
edges_ml(n, layers1 = character(0), layers2 = character(0))
edges_idx_ml(n)

num_layers_ml(n)
num_actors_ml(n, layers = character(0))
num_vertices_ml(n, layers = character(0))
num_edges_ml(n, layers1 = character(0), layers2 = character(0))

Arguments

n

A multilayer network.

layers

An array of names of layers belonging to the network. Only the actors/vertices in these layers are returned. If the array is empty, all the vertices in the network are returned. Notice that this may not correspond to the list of actors: there can be actors that are not present in any layer. These would be returned only using the actors_ml function.

layers1

The layer(s) from where the edges to be extracted start. If an empty list of layers is passed (default), all the layers are considered.

layers2

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

Value

actors_ml and layers_ml return an array of respectively actor and layer names. vertices_ml returns a data frame where each row contains the name of the actor corresponding to that vertex and the layer of the vertex. edges_ml returns a data frame where each row contains two actor names (i.e., an edge), the name of the two layers connected by the edge (which can be the same layer if it is an intra-layer edge) and the type of edge (directed/undirected).

edges_idx_ml returns the index of the vertex as returned by the vertices_ml function instead of its name - this is used internally by the plotting function.

The functions num_* compute the number of objects of the requested type.

See Also

Examples

net <- ml_aucs()
actors_ml(net)
layers_ml(net)
vertices_ml(net)
# only vertices in the "facebook" layer
vertices_ml(net,"facebook")
# all edges
edges_ml(net)
# Only edges inside the "lunch" layer
edges_ml(net,"lunch","lunch")
# Does the same as in the previous line
edges_ml(net,"lunch")
# Returns an empty  data frame, because there are no edges from the
# "lunch" layer to the "facebook" layer
edges_ml(net,"lunch","facebook")

num_actors_ml(net)
num_layers_ml(net)
num_vertices_ml(net)
# Only vertices in the "facebook" layer are counted
num_vertices_ml(net,"facebook")
num_edges_ml(net)
# Only edges inside the "lunch" layer are counted
num_edges_ml(net,"lunch","lunch")
# Does the same as in the previous line
num_edges_ml(net,"lunch")
# Returns 0, because there are no edges from the "lunch" layer to
# the "facebook" layer
num_edges_ml(net,"lunch","facebook")

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.