degree.multiplex: Layers' nodes' degree of the multiplex network

Description Usage Arguments Value References See Also Examples

Description

This function calculates the degree of the nodes on each (intra)layer of the multiplex network, combining the graph.multiplex and igraph's degree functions. For (intra)layers with directed relationships, the modeDirected argument allows to evaluate 'in-degree', 'out-degree' and 'total degree' descriptors, though by default the function returns only the total degree.

Usage

1
  degree.multiplex(obj, indexNode = 1:length(nodes.multiplex(obj)), modeDirected = FALSE)

Arguments

obj

An object of class multiplex.

indexNode

A vector of IDs (or labels) for the selected nodes on which to calculate the degree. Default selects all the nodes of the network.

modeDirected

Default is FALSE. If TRUE, the function evaluates 'in-degree' and 'out-degree' besides the usual 'total-degree' descriptor, for directed (intra)layers of the multiplex network.

Value

A list with, for each (intra)layer, a vector of degrees for the nodes selected with the indexNode argument. If modeDirected = TRUE, it adds a list with 'in-degree' and 'out-degree' besides 'total degree' in the directed (intra)layers' position inside the output.

References

Wassermann and Faust (1994), Social network analysis. Cambridge University Press.

See Also

create.multiplex, degree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Loading Aarhus CS Department dataset.

data(aarhus_mplex)

# Creating the multiplex object using the dataset loaded into aarhus_mplex object.

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
                            )

# Calculating the degrees of the 61 nodes of the multiplex network, for each layer:

degree.multiplex(mplexObj)

# Refining the evaluation only on 10 employees chosen, for each layer:

degree.multiplex(mplexObj, indexNode = 1:10, 10)

# Supposing one (or more) layers of the multiplex network have a directed relationship (for
# example, the third), we can obtain both the in-degree, out-degree and total-degree measures
# using the option 'modeDirected = TRUE':

# 1) Creating the multiplex network with a directed relationship (coauthor, L3)
mplexObjDirected <- create.multiplex(nodes = aarhus_mplex$nodes,
                                    layersNames = aarhus_mplex$layerNames,
                                    layer1 = aarhus_mplex$L1,
                                    type1 = "undirected",
                                    aarhus_mplex$L2,
                                    aarhus_mplex$L3,
                                    "directed",
                                    aarhus_mplex$L4,
                                    aarhus_mplex$L5
                                    )

# 2) Using the 'modeDirected = TRUE' option. Note the output and the list
# nested in $coauthor argument, containing the 3 measures:

degree.multiplex(mplexObjDirected, modeDirected = TRUE)
degree.multiplex(mplexObjDirected, modeDirected = TRUE)$coauthor

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