create.multiplex: Creation of the 'multiplex' structure

Description Usage Arguments Value Warning References Examples

Description

This function creates the multiplex structure, which is used in all the other functions of the package. This function implements the tensor-based framework proposed by De Domenico (2014) creating a list with nodes, layers and layers' names, adjacency matrices and types of relationships within each layer.

Usage

1
  create.multiplex(nodes, layersNames = FALSE, layer1, type1, ...)

Arguments

nodes

Any data.frame structure containing information about the nodes: for each row, the first column is the ID of the node, the second is the label with its name/description.

layersNames

Allows to specify a vector of labels for the layers given in input by the next arguments. Default is FALSE: in this case, the i-th layer will be called Layer(i).

layer1

Any data.frame or matrix structure containing the information about the first layer of the multiplex network: for each row, the first column is the ID of the starting node, the second is the ID of the ending node, the third is the weight of the relationship (1 if unweighted).

type1

A string describing the type of relationship expected for the first layer (layer1). It could be directed, undirected or any abbreviation.

...

This argument allows to input any other layer belonging to the multiplex network, in the same structure as layer1 argument. It also allows to specify the types of relationships of the layer (as in type1 argument), just after the layer's structure. If it is not specified, the relationship is assumed to be undirected.

Value

A list of the following objects, which will be useful in all the other functions developed in this package:

nodes

The same nodes object given in input, containing the information about the nodes of the multiplex structure;

layers

A list with all the data.frame structures (or matrix converted in data.frame) taken as input, in layer1 or ... argument;

adjacency

A list object with all the adjacency matrices, one for each layer of the multiplex network;

type

A vector object with all the strings describind the types of relationship, one for each layer of the multiplex network;

layersNames

A vector object containing all the strings for the labels of the layers. If given in input (with layersNames argument), it is the same vector.

interlayersMatrix

A N*L x N*L matrix object, where N is the number of nodes and L the number of layers of the multiplex network, rapresenting the interlayer structure as matrix of the adjacency matrices of the interlayer relationships between each couple of intralayers.

Warning

It is suggested to specify layersNames = FALSE argument even if no vector of layers names is given in input. If not, execution could cause problem/errors.

References

De Domenico et al (2014). Mathematical formulation of multilayer networks. Phys. Rev. X 3, 041022.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Loading Aarhus CS Department dataset.

data(aarhus_mplex)

# Creating the multiplex object using the dataset loaded into aarhus_mplex object.
# Note that all the layers refers to undirected relationship (so, their 'type'
# arguments are not specified).

mplexObj <- create.multiplex(nodes = aarhus_mplex$nodes,
                            layersNames = aarhus_mplex$layerNames,
                            layer1 = aarhus_mplex$L1,
                            type1 = "undirected",
                            aarhus_mplex$L2,
                            aarhus_mplex$L3,
                            aarhus_mplex$L4,
                            aarhus_mplex$L5
                            )

# Display the structure of the multiplex object created:

str(mplexObj)

Achab94/mplex documentation built on May 5, 2019, 11:46 a.m.