run_infomap_multi | R Documentation |
This function exports a multilayer network (as a list of igraph objects) into Infomap's required format, runs Infomap via an external binary, and imports the detected communities back into R as a data frame. It requires Infomap to be installed on the system. See installation instructions at Infomap.
run_infomap_multi(
igraph_list,
layer_names = NULL,
infomap_path = "infomap",
output_dir = tempdir(),
directed = TRUE,
two_level = TRUE,
multilayer_relax_rate = 0.15,
seed = 123
)
igraph_list |
A list of |
layer_names |
A character vector with layer names corresponding to each igraph object (default: |
infomap_path |
Character string specifying the path to the Infomap binary (default: |
output_dir |
Character string specifying the directory for Infomap results (default: |
directed |
Logical; if |
two_level |
Logical; if |
multilayer_relax_rate |
Numeric; relaxation rate for multilayer links (default: |
seed |
Numeric; random seed for Infomap to ensure reproducibility (default: |
If the network has the weight
attribute, it will be used as the weight of the edges.
A data frame containing the detected modules with columns:
Module/community assignment from Infomap.
The node name from the original igraph objects.
The corresponding layer name from layer_names
.
The fraction of flow assigned to the module.
D. Edler, A. Holmgren and M. Rosvall, The MapEquation software package, available online at https://www.mapequation.org.
## Not run:
# Load network data
fileName <- system.file("extdata", package = "multiweb")
dn <- list.files(fileName, pattern = "^Kefi2015.*\\.txt$")
g <- readNetwork(dn, fileName, skipColumn = 2)
class(g)
names(g) <- c("Negative", "Positive", "Trophic")
# Run Infomap
run_infomap_multi(g)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.