Write a Multilayer Network to a File in Infomap-Compatible Format
Source:R/modularity.R
write_multilayer_network.RdThis function writes a multilayer network (represented as a list of igraph objects) to a text file in Infomap's required *Intra format.
Value
A list with two data frames:
- vertices
A data frame of node IDs and names.
- intra
A data frame of intra-layer edges with columns:
layer_id,node_id1,node_id2,weight.
Details
The output file consists of:
A list of unique vertices with their numeric IDs.
Intra-layer edges with weights.
Examples
if (FALSE) { # \dontrun{
write_multilayer_network(list(layer1, layer2), "network.net")
} # }