run_infomap_monolayer: Run Infomap for monolayer networks with an option to compare...

View source: R/run_infomap_monolayer.R

run_infomap_monolayerR Documentation

Run Infomap for monolayer networks with an option to compare to randomized networks

Description

Run Infomap for monolayer networks. Returns the value of the map equation (L) and a tibble with modules that includes additional node metadata (if exists). Can also compare L_obs to that obtained from shuffled versions of the network.

Usage

run_infomap_monolayer(
  x,
  infomap_executable = "Infomap",
  flow_model = NULL,
  silent = F,
  trials = 100,
  two_level = T,
  seed = 123,
  signif = F,
  shuff_method = NULL,
  nsim = 1000,
  verbose = T,
  ...
)

Arguments

x

An object of class monolayer (see package emln for definition).

infomap_executable

Name of Infomap standalone file.

flow_model

See details here.

silent

Run in silent mode (argumnt –silent in Infomap).

trials

Number of trials to run (argumnt -N in Infomap).

two_level

Do not use hierarchical partitioning (argumnt -2 in Infomap). See details.

seed

Seed value for random number generation (argumnt –seed in Infomap).

signif

Should a comparison for non-random versions of the network be performed?

shuff_method

Method to shuffle the network. See details.

nsim

How many shuffled networks to create?

verbose

Show progress notes

...

additional Infomap arguments as detailed here.

Details

All of Infomap's arguments are detailed in https://www.mapequation.org/infomap/#Parameters.

Note on hierarchical partitioning: In Infomaps tree output, the path column is a tree-like format, like that: 1:3:4:2. The first integer is the top module. The last integer after the colon indicates the ID of the leaf in the module, and not the ID of the node. In this example, the node is the 2nd leaf in module 4, which is nested in module 3, which is nested in top module 1. run_infomap_monolayer automatically parses this output to levels. In this example, there are 3 module levels and the last is the leaf level. This will create columns: module_level1, module_level2, module_level3, module_level4. The column levels will show 3 because it ignores the leaf level. In case a node has fewer levels because its node is not partitioned, then the missing levels will show an NA value. A second node in the same network with a path 2:1:5 will be the 5th leaf in module 1 of module 2. The values for this node will be: module_level1=2, module_level2=1, module_level3=5, module_level4=NA.

If significance is TRUE then the network will be shuffled according to shuff_method. shuff_method can be either a list of already shuffled networks, produced for example with shuffle_infomap, or a shuffling method from vegan::commsim. Currently only supports shuffling for bipartite networks from the vegan package as defined in vegan::commsim. If special arguments such as burnin or thinin are needed for shuffling (e.g., for sequential algorithms), then first run shuffle_infomap separtely and provide the result as a list to shuff_method. This is because the ... argument passes additional arguments to Infomap, and not to shuffle_infomap. Significance is estimate as a 1-tailed test:

P_value = sum(L_sim<L)/nsim

This is the same common method to calculate significance for modularity, only that the goal is to minimize the map equation.

x is an object of class monolayer that is internally converted to an object of class infomap_link_list.

Value

An object of class infomap_monolayer.

Note

This is a beta version, that should eventually replace run_infomap_monolayer.

See Also

create_monolayer_network, monolayer, shuffle_infomap, infomap_monolayer


Ecological-Complexity-Lab/infomap_ecology_package documentation built on June 6, 2024, 5:28 a.m.