run_infomap | R Documentation |
This function exports an igraph network to Infomap's required format, runs Infomap, and imports the detected communities back into R as an igraph-compatible cluster object. It requires the installation of infomap in the system from https://www.mapequation.org/infomap/#Install if the network has the weight attribute, it will be used as the weight of the edges.
run_infomap(
graph,
infomap_path = "infomap",
output_dir = tempdir(),
directed = TRUE,
two_level = TRUE,
seed = 123
)
graph |
An igraph object. |
infomap_path |
Path to the Infomap binary (default assumes it's in system PATH). |
output_dir |
Temporary directory for Infomap results. |
directed |
Boolean: Treat the network as directed (default TRUE). |
two_level |
Boolean: Use two-level Infomap (default TRUE). |
seed |
Numeric: Random seed for Infomap (default 123). |
An igraph community object similar to igraph's cluster_infomap.
# Example with the intermediate files in actual folder
py_infomap <- run_infomap(netData[[1]],output_dir=".", weighted = FALSE)
membership(py_infomap)
modularity(py_infomap)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.