Description Usage Arguments Details Value Warnings References See Also Examples
Computes Battiston et al.'s C2 local clustering coefficient of a multiplex network.
1 2 3 4 | c2Local.multiplex(obj,
indexNode = 1:length(nodes.multiplex(obj)),
indexLayer = 1:length(layers.multiplex(obj))
)
|
obj |
An object of class |
indexNode |
A vector of IDs (or labels) for the selected nodes on which to calculate the C2 local clustering coefficient. |
indexLayer |
A vector of IDs (or labels) for the selected (intra)layers on which to calculate the C2 local clustering coefficient. |
Instead of the classical definition of transitivity and local clustering coefficient, this index accounts for all the possible tradics structures that takes form even considering interlayers relationships. The index is defined, for a certain node v_i (possibly selected with indexNode
argument) as the ratio between the number of 3-triangles that contains v_i, and (L - 2) times the number of 2-traids centred in v_i, defines L as the number of (intra)layers taken into consideration.
Function use permutations() function from gtools package. More informations available at https://cran.r-project.org/web/packages/gtools/index.html.
A numerical vector
with all the C2 local clustering coefficients for the nodes selected in indexNode
argument.
Note that the C2 local clustering coefficient can be defined for a multiplex network with, at least, 3 (intra)layers. So, if indexLayer
argument has length <3, the function produces an error and halts.
Battiston et al. (2014) Structural measures for multiplex networks. Phys. Rev. E 89, 032804.
create.multiplex
, C2Global.multiplex
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 | # 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
)
# Computing the so-called c2 clustering index for the nodes of the multiplex network:
c2Local.multiplex(mplexObj)
# It can be useful to select just some nodes or layers on which to calculate the
# c2 clustering index. This can be easily done with 'indexNode' and 'indexLayer' arguments:
c2Local.multiplex(mplexObj,
indexNode = sample(1:length(nodes.multiplex(mplexObj)), 10),
indexLayer = c(1, 3, 4)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.