write_multilayer_network: Write a Multilayer Network to a File in Infomap-Compatible...

View source: R/modularity.R

write_multilayer_networkR Documentation

Write a Multilayer Network to a File in Infomap-Compatible Format

Description

This function writes a multilayer network (represented as a list of igraph objects) to a text file in Infomap's required *Intra format.

Usage

write_multilayer_network(igraph_list, file_path)

Arguments

igraph_list

A list of igraph objects, each representing a layer.

file_path

A string specifying the path to the output file.

Details

The output file consists of:

  • A list of unique vertices with their numeric IDs.

  • Intra-layer edges with weights.

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.

Examples

## Not run: 
  write_multilayer_network(list(layer1, layer2), "network.net")

## End(Not run)


lsaravia/EcoNetwork documentation built on April 5, 2025, 1:51 p.m.