| Title: | Community Detection using Infomap, Inspired by Ecological Networks |
|---|---|
| Description: | Collection of R functions to perform community detection analysis with Infomap. Inspired by ecological networks but can work for other networks too! Ideas/requests for features are welcome (open an issue here: https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues). This work was supported by research grant ISF (Israel Science Foundation) 1281/20 to Shai Pilosof. |
| Authors: | Shai Pilosof <[email protected]> |
| Maintainer: | Geut Galai <[email protected]>, Shai Pilosof <[email protected]> |
| License: | GPL |
| Version: | 2.0.3 |
| Built: | 2026-12-03 11:24:02 UTC |
| Source: | https://github.com/Ecological-Complexity-Lab/infomap_ecology_package |
Attempts to run Infomap via the system command to make sure it works propoerly.
check_infomap(x = "./Infomap")check_infomap(x = "./Infomap")
x |
The name of the Infomap executable file. |
For now, this package depends on Infomap's stand-alone version. Futre versions or another package will incorporate Infomap directly into R.
FALSE and an error if Infomap is not installed correctly. TRUE (and version number) if it is.
check_infomap()check_infomap()
Takes a monolayer object and returns a link list and a tibble with nodes.
create_infomap_linklist( x, make_directed = F, write_to_file = F, output_file = "infomap_link_list.txt" )create_infomap_linklist( x, make_directed = F, write_to_file = F, output_file = "infomap_link_list.txt" )
x |
A monolayer object created with |
make_directed |
for undirected networks, create two sets of edges. |
write_to_file |
write the link list into a file? |
output_file |
the name of the output file (default is 'infomap_link_list.txt') |
Used internally by run_infomap_monolayer, but also useful for writing the link list to a file.
An object of class infomap_link_list, which is an R list with:
edge_list_infomap A link list (format: from, to, weight) formatted for Infomap, with node IDs
nodes A tibble with node IDs, names and possibly other attributes.
infomap_link_list
network_object <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE, directed = FALSE, group_names = c('A','P')) x <- create_infomap_linklist(network_object, make_directed = FALSE, write_to_file = FALSE)network_object <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE, directed = FALSE, group_names = c('A','P')) x <- create_infomap_linklist(network_object, make_directed = FALSE, write_to_file = FALSE)
Generate colors for ggplot
gg_color_hue(n, hue_min = 10, hue_max = 280, tune1 = 62, tune2 = 100)gg_color_hue(n, hue_min = 10, hue_max = 280, tune1 = 62, tune2 = 100)
n |
See package metafolio |
hue_min |
See package metafolio |
hue_max |
See package metafolio |
tune1 |
See package metafolio |
tune2 |
See package metafolio |
Taken from package metafolio. See details there
A network object of class infomap_link_list contains all the necessary information and R objects to run Infomap and parse the results back to R.
An R list with:
edge_list_infomap A link list (format: from, to, weight) formatted for Infomap, with node IDs
nodes A tibble with node IDs, names and possibly other attributes.
create_infomap_linklist
An object of class infomap_multialyer contains all the information resulting from an analysis of modularity on multilayer networks. It facilitates subsequernt analyses and plotting.
A list with:
call The call to Infomap with all the arguments.
L The value of the map equation.
m Number of modules.
modules A tibble with nodes, their module affiliations, and node attributes.
run_infomap_multilayer
An object of class infomap_monolayer contains all the information resulting from an analysis of modularity. It facilitates subsequernt analyses and plotting.
A list with:
call The call to Infomap with all the arguments.
L The value of the map equation for the observed network.
m The number of top modules for the observed network.
modules A tibble with node id, module affiliations and node attributes if they exist.
edge_list The original edge list (network).
L_sim A vector with values of L for the shuffled network, with length as the number
m_sim A vector with the number of modules for the shuffled network, with length as the numberof randomizations. NULL if significance test was not performed.
pvalue P value of comparison to randomizations. NULL if significance test was not performed.
run_infomap_monolayer
The package contains functions that prepare monolayer and multilayer networks for analysis with Infomap, run Infomap from within R and parse the results back to R. Also includes standardized objects to store and further analyze monolayer and multilayer networks. The package is inspired by analysis of ecological networks but is suitable for other areas of research as well.
We use Infomap as a stand-alone file. Future versions will integrate Infomap directly into R. Complete instructions on how to download, install and use Infomap can be found in https://www.mapequation.org. The best practice is to compile Infomap under the file name Infomap and place it in the same working folder in which the R code is run. See details in https://ecological-complexity-lab.github.io/infomap_ecology_package/installation
The package also includes several data sets of ecological networks.
Ideas/requests for features are welcome (open an issue https://github.com/Ecological-Complexity-Lab/infomap_ecology_package/issues).
Shai Pilosof
Farage C, Edler D, Eklöf A, Rosvall M, Pilosof S. Identifying flow modules in ecological networks using Infomap. Methods in Ecology and Evolution 2021. doi:10.1111/2041‐210X.13569
Downloads the latest binary release version from MapEquation according to the
machine's operating system (Windows/MacOS/Linux). Unix based OS users have
the option to download the latest version in development from the git.
In that case it clones the GitHub repository and runs make via R's
system command. This is merely a wrapper for commands that can be
easily run in the terminal.
install_infomap(target_folder = NULL, source = "binary", version = "2.7.1")install_infomap(target_folder = NULL, source = "binary", version = "2.7.1")
target_folder |
Where to install Infomap. Defaults to R's current
working directory ( |
source |
The source to download Infomap from. Relevant only for Unix based operating systems. "git" to download the latest version from development, "binary" (default) to download the latest release version. |
version |
The version of Infomap to install. By default, it installs version 2.7.1. Users are encouraged to check for the latest version. |
Users have the option to download the specific version by providing the argument version
If version is not provided, it installs version 2.7.1.
For now, this package depends on Infomap's stand-alone version. Future versions or another package will incorporate Infomap directly into R. Therefore it is necessary to install infomap in the same folder where the code is Run. If it is already installed, then it will be replaced. Check for a list of versions For full instructions see here
FALSE and an error if Infomap is not installed correctly. TRUE (and version number) if it is.
## Not run: install_infomap() ## End(Not run)## Not run: install_infomap() ## End(Not run)
Food web including metazoan parasites for an intertidal ecosystem in New Zealand.
data(kongsfjorden_links)data(kongsfjorden_links)
An object of class data.frame with 1544 rows and 5 columns.
The data set is included here "as is". In this network, nodes are species or taxonomical groups (e.g., Phytoplankton) and binary links represent feeding relationships. Kongsfjorden is a glacial fjord on the northwest corner of the Svalbard archipelago. It is a 30 km open fjord with no marked sill at the entrance, and with a maximum depth exceeding 300 m. The network consists of 262 species with 1,544 feeding interactions.
Jacob U, Thierry A, Brose U, Arntz WE, Berg S, Brey T, et al. The Role of Body Size in Complex Food Webs: A Cold Case. In: Belgrano A, editor. Advances in Ecological Research. Academic Press; 2011. pp. 181–223.
Cirtwill AR, Eklöf A. Feeding environment and other traits shape species’ roles in marine food webs. Ecol Lett. 2018;21: 875–884.
kongsfjorden_nodes
data(kongsfjorden_links)data(kongsfjorden_links)
Food web including metazoan parasites for an intertidal ecosystem in New Zealand.
data(kongsfjorden_nodes)data(kongsfjorden_nodes)
An object of class data.frame with 262 rows and 5 columns.
The data set is included here "as is". In this network, nodes are species or taxonomical groups (e.g., Phytoplankton) and binary links represent feeding relationships. Kongsfjorden is a glacial fjord on the northwest corner of the Svalbard archipelago. It is a 30 km open fjord with no marked sill at the entrance, and with a maximum depth exceeding 300 m. The network consists of 262 species with 1,544 feeding interactions.
Jacob U, Thierry A, Brose U, Arntz WE, Berg S, Brey T, et al. The Role of Body Size in Complex Food Webs: A Cold Case. In: Belgrano A, editor. Advances in Ecological Research. Academic Press; 2011. pp. 181–223.
Cirtwill AR, Eklöf A. Feeding environment and other traits shape species’ roles in marine food webs. Ecol Lett. 2018;21: 875–884.
kongsfjorden_links
data(kongsfjorden_nodes)data(kongsfjorden_nodes)
Calculate normalized mutual information based on a confusion matrix. Very useful for comparing between two partition structures of a network.
NMI(N)NMI(N)
N |
A confusion matrix. |
If the partitions are exactly the same then all the nodes that appear in a given module in the first network will also appear in the same module in the second network. In this case, the confusion matrix will have all the values on the diagonal, and NMI=1.
Value between 0 (no mutual information) to 1 (complete mutual information).
Danon L, Díaz-Guilera A, Duch J, Arenas A. Comparing community structure identification. J Stat Mech. 2005;2005: P09008.
Guimerà R, Sales-Pardo M, Amaral LAN. Module identification in bipartite and directed networks. Phys Rev E Stat Nonlin Soft Matter Phys. 2007;76: 036102.
Pilosof S, Fortuna MA, Cosson J-FC, Galan M, Kittipong C, Ribas A, et al. Host-parasite network structure is associated with community-level immunogenetic diversity. Nat Commun. 2014;5: 5172.
# Generate a confusion martrix for a network with 50 modules. # Partition A has 6 modules (rows), partition B has 5 (columns). # Each cell in N indicates the number of nodes that were assigned # together to a module in A and B. For example, 5 nodes were assigned # to module 2 in partition A and to module 1 in partition B. N <- matrix(0,6,5) diag(N[-1,])<-c(5,2,6,5,5) diag(N) <- c(4,4,6,5,5) N[6,1] <- 2 N[1,4] <- 1 NMI(N) # An example of perfect information (exact same partitions): N <- matrix(0,5,5) diag(N) <- c(10,15,10,12,3) NMI(N) # Should be 1# Generate a confusion martrix for a network with 50 modules. # Partition A has 6 modules (rows), partition B has 5 (columns). # Each cell in N indicates the number of nodes that were assigned # together to a module in A and B. For example, 5 nodes were assigned # to module 2 in partition A and to module 1 in partition B. N <- matrix(0,6,5) diag(N[-1,])<-c(5,2,6,5,5) diag(N) <- c(4,4,6,5,5) N[6,1] <- 2 N[1,4] <- 1 NMI(N) # An example of perfect information (exact same partitions): N <- matrix(0,5,5) diag(N) <- c(10,15,10,12,3) NMI(N) # Should be 1
Food web including metazoan parasites for an intertidal ecosystem in New Zealand.
data(otago_links)data(otago_links)
An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 1924 rows and 16 columns.
The data set is included here "as is". It contains metadata on nodes (see otago_nodes).
The links between nodes are directed and binary.
Original data set on Figshare.
Mouritsen KN, Poulin R, McLaughlin JP, Thieltges DW. Food web including metazoan parasites for an intertidal ecosystem in New Zealand: Ecological Archives E092-173. Ecology. 2011;92: 2006–2006.
otago_nodes
data(otago_links)data(otago_links)
Food web including metazoan parasites for an intertidal ecosystem in New Zealand.
data(otago_nodes)data(otago_nodes)
An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 180 rows and 41 columns.
The data set is included here "as is". This data set contains all the node attributes (metadata).
The links between nodes. Links are in otago_links
Original data set on Figshare.
Mouritsen KN, Poulin R, McLaughlin JP, Thieltges DW. Food web including metazoan parasites for an intertidal ecosystem in New Zealand: Ecological Archives E092-173. Ecology. 2011;92: 2006–2006.
otago_links
data(otago_nodes)data(otago_nodes)
Plot a matrix with colored interactions by modules
plot_modular_matrix( x, fix_coordinates = T, axes_titles = c("Set 1", "Set 2"), transpose = F, outside_module_col = "gray" )plot_modular_matrix( x, fix_coordinates = T, axes_titles = c("Set 1", "Set 2"), transpose = F, outside_module_col = "gray" )
x |
An object of class |
fix_coordinates |
Should x and y coordinates be fixed by ggplot to create square cells. |
axes_titles |
Titles for axes |
transpose |
Option to transpose the matrix. Useful for matrices with very differnt numbers of rows and columns. |
outside_module_col |
Color of interactions outside modules. |
Use ggplot to plot a matrix in which cells (network interactions)
are colored. Interactions that fall outside the modules are colored in
outside_module_col and those that fall inside the module are colored
by colors automatically generated by gg_color_hue from package metafolio.
An object of class ggplot.
ggplot2, infomap_monolayer
## Not run: network_object <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE, directed = FALSE, group_names = c('A','P')) infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap', flow_model = 'undirected', silent=TRUE, trials=20, two_level=TRUE, seed=123) plot_modular_matrix(infomap_object, fix_coordinates = TRUE) ## End(Not run)## Not run: network_object <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE, directed = FALSE, group_names = c('A','P')) infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap', flow_model = 'undirected', silent=TRUE, trials=20, two_level=TRUE, seed=123) plot_modular_matrix(infomap_object, fix_coordinates = TRUE) ## End(Not run)
Alluvial plot for multilayer network
plot_multilayer_alluvial(x, module_labels = F)plot_multilayer_alluvial(x, module_labels = F)
x |
An object of class |
module_labels |
Should module labels be presented |
Use ggplot and ggalluvial to plot an alluvial plot that shows the flow of nodes between modules. Very useful for temporal networks. Because the output is a ggplot object it can be further manipulated with standard ggplot2.
An object of class ggplot.
ggplot2, ggalluvial, infomap_monolayer
## Not run: emln <- create_multilayer_object(extended = siberia1982_7_links, nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE) emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294, temporal_network = TRUE) # Plot alluvial diagram plot_multilayer_alluvial(emln_modules, module_labels = FALSE) # Can also modify the plot plot_multilayer_alluvial(emln_modules, module_labels = FALSE)+ geom_stratum(linetype='dashed', color='gray')+ scale_x_continuous(breaks=seq(0,6,1))+ scale_y_continuous(breaks=seq(0,70,5))+ labs(y='Number of species')+ theme_bw()+ theme(legend.position = "none", panel.grid = element_blank(), axis.text = element_text(color='black', size = 20), axis.title = element_text(size=20)) ## End(Not run)## Not run: emln <- create_multilayer_object(extended = siberia1982_7_links, nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE) emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294, temporal_network = TRUE) # Plot alluvial diagram plot_multilayer_alluvial(emln_modules, module_labels = FALSE) # Can also modify the plot plot_multilayer_alluvial(emln_modules, module_labels = FALSE)+ geom_stratum(linetype='dashed', color='gray')+ scale_x_continuous(breaks=seq(0,6,1))+ scale_y_continuous(breaks=seq(0,70,5))+ labs(y='Number of species')+ theme_bw()+ theme(legend.position = "none", panel.grid = element_blank(), axis.text = element_text(color='black', size = 20), axis.title = element_text(size=20)) ## End(Not run)
Plot modules across layers for multilayer networks
plot_multilayer_modules(x, type = c("circle", "rectangle"), color_modules = T)plot_multilayer_modules(x, type = c("circle", "rectangle"), color_modules = T)
x |
An object of class |
type |
Plot type, circles or rectangles. See details. |
color_modules |
Color modules? See details. |
Type circle plots a circle per module-layer combination, with the radius proportional
to the number of nodes in the module in the layer. Type rectangle plots a bar across all the layers a module spans. Only (or mostly) relevant for temporal networks.
For a circle plot, color_modules will give a different color for
each module ID. For a rectangle plot, color_modules will color each
module by the total number of nodes it contains (not per layer).
Because the output is a ggplot object it can be further manipulated with standard ggplot2.
An object of class ggplot.
Code was first developed for: Pilosof, S., Q. He, K. E. Tiedje, S. Ruybal-Pesántez, K. P. Day, and M. Pascual. 2019. Competition for hosts modulates vast antigenic diversity to generate persistent strain structure in Plasmodium falciparum. PLoS biology 17:e3000336.
ggplot2, infomap_monolayer
## Not run: emln <- create_multilayer_object(extended = siberia1982_7_links, nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE) emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294, temporal_network = TRUE) plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = TRUE)+ scale_fill_viridis_c() plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = FALSE)+ geom_rect(fill='orange') # Circle-type plot plot_multilayer_modules(emln_modules, type = 'circle', color_modules = TRUE) plot_multilayer_modules(emln_modules, type = 'circle', color_modules = FALSE)+ geom_point(aes(size=size), color='navy') # More examples to modify the plots plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = TRUE)+ scale_fill_viridis_c()+ scale_x_continuous(breaks=seq(0,6,1))+ scale_y_continuous(breaks=seq(0,40,5))+ theme_bw()+ theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), axis.title = element_text(size=20), axis.text = element_text(size = 20), legend.text = element_text(size=15), legend.title = element_text(size=20)) ## End(Not run)## Not run: emln <- create_multilayer_object(extended = siberia1982_7_links, nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE) emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE, flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294, temporal_network = TRUE) plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = TRUE)+ scale_fill_viridis_c() plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = FALSE)+ geom_rect(fill='orange') # Circle-type plot plot_multilayer_modules(emln_modules, type = 'circle', color_modules = TRUE) plot_multilayer_modules(emln_modules, type = 'circle', color_modules = FALSE)+ geom_point(aes(size=size), color='navy') # More examples to modify the plots plot_multilayer_modules(emln_modules, type = 'rectangle', color_modules = TRUE)+ scale_fill_viridis_c()+ scale_x_continuous(breaks=seq(0,6,1))+ scale_y_continuous(breaks=seq(0,40,5))+ theme_bw()+ theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), axis.title = element_text(size=20), axis.text = element_text(size = 20), legend.text = element_text(size=15), legend.title = element_text(size=20)) ## End(Not run)
Plot histograms for randomizations
plot_signif(x, colors = c("plum", "tomato4"), plotit = T)plot_signif(x, colors = c("plum", "tomato4"), plotit = T)
x |
An object of class |
colors |
The fill colors of the histograms. |
plotit |
Also show the plots? |
Use ggplot to plot two histograms for the values of the map equation L and the number of modules. Dashed line is the observed value. Because returned objects are ggplot objects, they can be modified.
A list with objecst of class ggplot:
L_plot: Histogram for the map equation
m_plot: Histogram for the number of modules
ggplot2, infomap_monolayer
## Not run: network_object <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE, directed = FALSE, group_names = c('Animals','Plants')) infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap', flow_model = 'undirected', silent=TRUE, trials=20, two_level=TRUE, seed=123, signif = TRUE, shuff_method = 'r00', nsim = 50) #get plots and plot them x <- plot_signif(infomap_object, plotit = TRUE) # Can modify the plots with ggplot2 x$L_plot+ theme_bw()+ theme(legend.position='none', axis.text = element_text(size=20), axis.title = element_text(size=20)) ## End(Not run)## Not run: network_object <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE, directed = FALSE, group_names = c('Animals','Plants')) infomap_object <- run_infomap_monolayer(network_object, infomap_executable='Infomap', flow_model = 'undirected', silent=TRUE, trials=20, two_level=TRUE, seed=123, signif = TRUE, shuff_method = 'r00', nsim = 50) #get plots and plot them x <- plot_signif(infomap_object, plotit = TRUE) # Can modify the plots with ggplot2 x$L_plot+ theme_bw()+ theme(legend.position='none', axis.text = element_text(size=20), axis.title = element_text(size=20)) ## End(Not run)
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.
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, ... )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, ... )
x |
An object of class |
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. |
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.
An object of class infomap_monolayer.
This is a beta version, that should eventually replace
run_infomap_monolayer.
create_monolayer_network, monolayer, shuffle_infomap, infomap_monolayer
Run Infomap for multilayer networks using a multilayer class object.
Returns the value of the map equation and a tibble with module affiliations
that includes additional node metadata (if exists).
run_infomap_multilayer( M, infomap_executable = "./Infomap", flow_model = NULL, silent = T, trials = 100, seed = NULL, relax = F, multilayer_relax_rate = 0.1, multilayer_relax_limit = NULL, multilayer_relax_limit_up = NULL, multilayer_relax_limit_down = NULL, temporal_network = F, run_standalone = T, remove_auxilary_files = T, ... )run_infomap_multilayer( M, infomap_executable = "./Infomap", flow_model = NULL, silent = T, trials = 100, seed = NULL, relax = F, multilayer_relax_rate = 0.1, multilayer_relax_limit = NULL, multilayer_relax_limit_up = NULL, multilayer_relax_limit_down = NULL, temporal_network = F, run_standalone = T, remove_auxilary_files = T, ... )
M |
An object of class |
infomap_executable |
Path to the Infomap standalone file (default is ./Infomap). |
flow_model |
See details in https://www.mapequation.org/infomap/#ParamsAlgorithm. |
silent |
Run in silent mode (argumnt –silent in Infomap). |
trials |
Number of trials to run (argumnt -N in Infomap). |
seed |
Seed value for random number generation (argumnt –seed in Infomap). |
relax |
Should dynamics of movement between layers be fully encoded by interlayer edges, or should they be relaxed. See details. |
multilayer_relax_rate |
Probability to relax the constraint to move only in the current layer. |
multilayer_relax_limit |
Number of neighboring layers in each direction to relax to. If negative, relax to any layer. |
multilayer_relax_limit_up |
Number of neighboring layers with higher id to relax to. If negative, relax to any layer. Useful for temporal networks. |
multilayer_relax_limit_down |
Number of neighboring layers with lower id to relax to. If negative, relax to any layer. Useful for temporal networks. |
temporal_network |
Is this a temporal network? See details. |
run_standalone |
Should the function run Infomap's stand-alone file? Defaults to true. See details. |
remove_auxilary_files |
Should auxilary files be removed when finished running? |
... |
additional Infomap arguments as detailed in https://www.mapequation.org/infomap/#Parameters |
Currently only works with two-level solutions (no modules within modules).
When relax=F, Infomap uses an input format that gives full control of the dynamics, explicitly using interlayer edges, and no other movements are encoded. This uses the extended edge list format and you have to specify all intra-layer and inter-layer links explicitly.
However, it is often useful to consider a dynamics in which a random walker moves within a layer and with a given relax rate jumps to another layer without recording this movement, such that the constraints from moving in different layers can be gradually relaxed. This is obtained with a different input format that explicitly divides the links into intra-layer and inter-layer links. To use relaxation, you only specify intralayer edges (use 'intra_output_extended=F' in 'create_multilayer_object') and the links between layers are generated automatically by inter-layer relaxation (parameter 'multilayer-relax-rate'). Relaxing between layers can also be constrained by interlayer links. For this, include interlayer links and set 'inter_output_extended=F' in 'create_multilayer_object'. Relaxing requires specification of relax rates and limits. When these are not specified, Infomap uses defaults as detailed here.
If the multilayer is a temporal network, modules can be renamed to be
placed in temporal order of appearance. This is done with
temporal_network=T.
run_standalone: Infomap is run as a stand-alone file. On some machines, especially Windows, it is impossible to install
that file or it gives an error. In that case you can use the auxilary file produced by the function, called
infomap_multilayer.txt to run Infomap online, download the results and parse them back.
The function will wait to parse the results.
An object of class infomap_multilayer
create_multilayer_object, multilayer, infomap_multilayer
# Examples are available on our website # https://ecological-complexity-lab.github.io/infomap_ecology_package/multilayer_relax_emln.html# Examples are available on our website # https://ecological-complexity-lab.github.io/infomap_ecology_package/multilayer_relax_emln.html
Shuffles the network according to a predefined algorithm and return a list of linklists that can be analyzed by Infomap.
shuffle_infomap(x, shuff_method = "r00", nsim = 1000, ...)shuffle_infomap(x, shuff_method = "r00", nsim = 1000, ...)
x |
An object of class |
shuff_method |
Method to shuffle the network. See details. |
nsim |
How many shuffled networks to create? |
... |
Additional parameters for shuffling passed to |
This function is used internally by
run_infomap_monolayer, but can also be run independently
Currently only supports bipartite networks and shuffling methods from the
vegan package as defined in vegan::commsim.
A list of linklists that can be used by Infomap.
Functions commsim, nullmodel in package vegan.
network_object <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE, directed = FALSE, group_names = c('A','P')) shuffled <- shuffle_infomap(network_object, shuff_method='curveball', nsim=50, burnin=2000)network_object <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE, directed = FALSE, group_names = c('A','P')) shuffled <- shuffle_infomap(network_object, shuff_method='curveball', nsim=50, burnin=2000)
Host-parasite temporal multilayer network. This data set contains the matrices of a temporal multilayer network representing the infection of 22 small mammalian host species by 56 ectoparasite species during 6 consecutive summers in Siberia (1982–1987).
data(siberia_interlayer)data(siberia_interlayer)
Edge list format (layer_from node_from layer_to node_to weight).
The data set is in an matrix format.Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer coupling edges connect each physical node to itself in the next layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as the number of individuals in layer l+1 divided by the number of individuals in layer l. They therefore represent population dynamics. Interlayer edges only go one way (_l–>l+1_) because time flow one way.
See siberia_nodes for information about the nodes.
See siberia1982_matrix Siberia 1982 host-parasite temporal matrix.
Simulated data for illustration purposes.
Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128.
Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996.
Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101.
data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, interlayer_links = siberia_interlayer, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, interlayer_links = siberia_interlayer, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )
Host-parasite temporal multilayer network. This data set contains the matrices of a temporal multilayer network representing the infection of 22 small mammalian host species by 56 ectoparasite species during 6 consecutive summers in Siberia (1982–1987).
data(siberia_nodes)data(siberia_nodes)
An object of class matrix (inherits from array) with 3 rows and 4 columns.
The data set is in an matrix format.Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer coupling edges connect each physical node to itself in the next layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as the number of individuals in layer l+1 divided by the number of individuals in layer l. They therefore represent population dynamics. Interlayer edges only go one way (_l–>l+1_) because time flow one way.
See siberia1982_matrix Siberia 1982 host-parasite temporal matrix.
See siberia_interlayer for information about the interlayer edges.
Simulated data for illustration purposes.
Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128.
Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996.
Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101.
data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )
Host-parasite temporal multilayer network. This data set contains the matrices of a temporal multilayer network representing the infection of 22 small mammalian host species by 56 ectoparasite species during 6 consecutive summers in Siberia (1982–1987).
data(siberia1982_matrix)data(siberia1982_matrix)
A numeric matrix with rows representing host species and columns representing parasite species.
The data set is in an matrix format.Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer coupling edges connect each physical node to itself in the next layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as the number of individuals in layer l+1 divided by the number of individuals in layer l. They therefore represent population dynamics. Interlayer edges only go one way (_l–>l+1_) because time flow one way.
See siberia_nodes for information about the nodes.
See siberia_interlayer for information about the interlayer edges.
Simulated data for illustration purposes.
Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128.
Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996.
Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101.
data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )
Host-parasite temporal multilayer network. This data set contains the matrices of a temporal multilayer network representing the infection of 22 small mammalian host species by 56 ectoparasite species during 6 consecutive summers in Siberia (1982–1987).
data(siberia1983_matrix)data(siberia1983_matrix)
A numeric matrix with rows representing host species and columns representing parasite species.
The data set is in an matrix format.Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer coupling edges connect each physical node to itself in the next layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as the number of individuals in layer l+1 divided by the number of individuals in layer l. They therefore represent population dynamics. Interlayer edges only go one way (_l–>l+1_) because time flow one way.
See siberia_nodes for information about the nodes.
See siberia_interlayer for information about the interlayer edges.
Simulated data for illustration purposes.
Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128.
Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996.
Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101.
data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )
Host-parasite temporal multilayer network. This data set contains the matrices of a temporal multilayer network representing the infection of 22 small mammalian host species by 56 ectoparasite species during 6 consecutive summers in Siberia (1982–1987).
data(siberia1984_matrix)data(siberia1984_matrix)
A numeric matrix with rows representing host species and columns representing parasite species.
The data set is in an matrix format.Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer coupling edges connect each physical node to itself in the next layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as the number of individuals in layer l+1 divided by the number of individuals in layer l. They therefore represent population dynamics. Interlayer edges only go one way (_l–>l+1_) because time flow one way.
See siberia_nodes for information about the nodes.
See siberia_interlayer for information about the interlayer edges.
Simulated data for illustration purposes.
Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128.
Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996.
Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101.
data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )
Host-parasite temporal multilayer network. This data set contains the matrices of a temporal multilayer network representing the infection of 22 small mammalian host species by 56 ectoparasite species during 6 consecutive summers in Siberia (1982–1987).
data(siberia1985_matrix)data(siberia1985_matrix)
A numeric matrix with rows representing host species and columns representing parasite species.
The data set is in an matrix format.Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer coupling edges connect each physical node to itself in the next layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as the number of individuals in layer l+1 divided by the number of individuals in layer l. They therefore represent population dynamics. Interlayer edges only go one way (_l–>l+1_) because time flow one way.
See siberia_nodes for information about the nodes.
See siberia_interlayer for information about the interlayer edges.
Simulated data for illustration purposes.
Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128.
Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996.
Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101.
data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )
Host-parasite temporal multilayer network. This data set contains the matrices of a temporal multilayer network representing the infection of 22 small mammalian host species by 56 ectoparasite species during 6 consecutive summers in Siberia (1982–1987).
data(siberia1986_matrix)data(siberia1986_matrix)
A numeric matrix with rows representing host species and columns representing parasite species.
The data set is in an matrix format.Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer coupling edges connect each physical node to itself in the next layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as the number of individuals in layer l+1 divided by the number of individuals in layer l. They therefore represent population dynamics. Interlayer edges only go one way (_l–>l+1_) because time flow one way.
See siberia_nodes for information about the nodes.
See siberia_interlayer for information about the interlayer edges.
Simulated data for illustration purposes.
Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128.
Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996.
Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101.
data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )
Host-parasite temporal multilayer network. This data set contains the matrices of a temporal multilayer network representing the infection of 22 small mammalian host species by 56 ectoparasite species during 6 consecutive summers in Siberia (1982–1987).
data(siberia1987_matrix)data(siberia1987_matrix)
A numeric matrix with rows representing host species and columns representing parasite species.
The data set is in an matrix format.Each layer is a host-parasite bipartite network. Intralayer edges between a parasite species and a host species are the number of parasite individuals divided by the number of host individuals. Interlayer coupling edges connect each physical node to itself in the next layer (e.g., host A in layer 1 to host A in layer 2), and are calculated as the number of individuals in layer l+1 divided by the number of individuals in layer l. They therefore represent population dynamics. Interlayer edges only go one way (_l–>l+1_) because time flow one way.
See siberia_nodes for information about the nodes.
See siberia_interlayer for information about the interlayer edges.
Simulated data for illustration purposes.
Krasnov BR, Matthee S, Lareschi M, Korallo-Vinarskaya NP, Vinarski MV. Co-occurrence of ectoparasites on rodent hosts: null model analyses of data from three continents. Oikos. 2010;119: 120–128.
Pilosof S, Fortuna MA, Vinarski MV, Korallo-Vinarskaya NP, Krasnov BR. Temporal dynamics of direct reciprocal and indirect effects in a host-parasite network. J Anim Ecol. 2013;82: 987–996.
Pilosof S, Porter MA, Pascual M, Kéfi S. The multilayer nature of ecological networks. Nature Ecology & Evolution. 2017;1: 0101.
data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )data(siberia1982_matrix) data(siberia1983_matrix) data(siberia1984_matrix) data(siberia1985_matrix) data(siberia1986_matrix) data(siberia1987_matrix) data(siberia_nodes) data(siberia_interlayer) # Create a multilayer object layer_attrib <- tibble(layer_id=1:6, layer_name=c('1982','1983','1984','1985','1986','1987')) multilayer_siberia <- create_multilayer_network(list_of_layers = list(siberia1982_matrix, siberia1983_matrix, siberia1984_matrix, siberia1985_matrix, siberia1986_matrix, siberia1987_matrix), layer_attributes = layer_attrib, bipartite = TRUE, directed = FALSE, physical_node_attributes = siberia_nodes )
Data on conspecific and heterospecific movement of pollen grains.
data(tur2016)data(tur2016)
An object of class data.frame with 3897 rows and 10 columns.
Tur C, Sáez A, Traveset A, Aizen MA. Evaluating the effects of pollinator-mediated interactions using pollen transfer networks: evidence of widespread facilitation in south Andean plant communities. Ecol Lett. 2016;19: 576–586.
data(tur2016)data(tur2016)