Conversion: Conversion to a simple or multi graph

multinet.conversionR Documentation

Conversion to a simple or multi graph

Description

Constructs a single graph resulting from merging one or more layers of the network and converts it into an iGraph object.

Usage

## S3 method for class 'Rcpp_RMLNetwork'
as.igraph(x, layers = NULL, merge.actors = TRUE, all.actors = FALSE, ...)

Arguments

x

A multilayer network.

layers

A vector of names of layers. If NULL, all layers are included in the result.

merge.actors

Whether the vertices corresponding to each actor should be merged into a single vertex (true) or kept separated (false).

all.actors

Whether all actors in the multilayer network should be included in the result (true) or only those present in at least one of the input layers (false). This option does not currently make any difference, as only actors who are present in at least one layer can exist since version 4.0.

...

Additional arguments. None currently.

Value

An object of class iGraph.

See Also

multinet.transformation

Examples

net <- ml_aucs()
# using the default merge.actors=TRUE we create a multigraph,
# where each actor corresponds to a vertex in the result
multigraph <- as.igraph(net)
# this is a simple graph corresponding to the facebook layer
facebook1 <- as.igraph(net, "facebook")
# this includes also the actors without a facebook account
facebook2 <- as.igraph(net, "facebook", all.actors=TRUE)
# two layers are converted to an igraph object, where two
# vertices are used for each actor: one corresponding to the
# vertex on facebook, one to the vertex on lunch
f_l_net <- as.igraph(net, c("facebook","lunch"),
    merge.actors=FALSE)

multinet documentation built on Feb. 16, 2023, 10:57 p.m.