Package {emln}


Type: Package
Title: Organize, Handle, and Explore Ecological Multilayer Networks
Version: 1.1.0
Date: 2026-04-20
URL: https://emln.ecomplab.com/
BugReports: https://github.com/Ecological-Complexity-Lab/emln/issues
Description: Data and analysis of ecological multilayer networks, including standardization of data structures and functions to convert between them. Includes an interactive multilayer network visualizer (beta, paper forthcoming), and a collection of 78 empirical ecological multilayer network datasets. This work was supported by research grant ISF (Israel Science Foundation) 1281/20 to Shai Pilosof. Noa Frydman (2023) <doi:10.1111/2041-210X.14225>.
License: CC BY 4.0
Encoding: UTF-8
LazyData: true
LazyDataCompression: xz
Depends: R (≥ 4.1.0)
Imports: magrittr, stringr, igraph, tibble, dplyr, purrr, tidyr, Matrix, DT, hablar, rlang
Suggests: bipartite, httpuv, testthat (≥ 3.0.0)
RoxygenNote: 7.3.2
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-05-03 12:56:17 UTC; geutgalai
Author: Noa Frydman [aut], Shai Pilosof [aut, fnd], Shirly Freilikhman [aut], Geut Galai [cre]
Maintainer: Geut Galai <geutg@post.bgu.ac.il>
Repository: CRAN
Date/Publication: 2026-05-05 19:20:12 UTC

emln: Organize, Handle, and Explore Ecological Multilayer Networks

Description

Data and analysis of ecological multilayer networks, including standardization of data structures and functions to convert between them. Includes an interactive multilayer network visualizer (beta, paper forthcoming), and a collection of 78 empirical ecological multilayer network datasets. This work was supported by research grant ISF (Israel Science Foundation) 1281/20 to Shai Pilosof. Noa Frydman (2023) doi:10.1111/2041-210X.14225.

Author(s)

Maintainer: Geut Galai geutg@post.bgu.ac.il

Authors:

See Also

Useful links:


Convert a data.frame to a list of named lists (one per row)

Description

Convert a data.frame to a list of named lists (one per row)

Usage

.df_to_list_of_rows(df)

Resolve path to the bundled multilayer_viz web app

Description

Looks first for an installed copy at system.file("multilayer_viz", package = "emln"), then falls back to sibling/dev locations for in-source development.

Usage

.resolve_viz_path(viz_path = NULL)

Minimal JSON serializer (no dependency on jsonlite)

Description

Converts an R list structure to a JSON string. Supports: lists, vectors, strings, numbers, logicals, NULL.

Usage

.to_json(x, indent = 0)

Creates a monolayer network object.

Description

Automatically identifies if the input is a matrix or an edge list and creates a monolayer object.

Usage

create_monolayer_network(
  x,
  directed = NULL,
  bipartite = NULL,
  group_names = c("set_cols", "set_rows"),
  node_metadata = NULL
)

Arguments

x

input data in the format of a matrix, edge list or an igraph object.

directed

Is the network directed?

bipartite

Is the network bipartite? Ignored when the input is an igraph object.

group_names

For bipartite networks: name of the groups in the columns and rows, respectively (e.g., parasites and hosts).

node_metadata

Following the igraph method of graph_from_data_frame. First column must be have names matching those in x.

Details

Converts between edge list and matrix formats and creates a monolayer object. It a wrapper function for list_to_matrix, matrix_to_list_unipartite, matrix_to_list_bipartite. Node metadata can only be included with an edge list input.

Value

A monolayer object.

See Also

list_to_matrix, matrix_to_list_unipartite, monolayer.

Examples

library(igraph)

# A bipartite network from package bipartte
x <- create_monolayer_network(bipartite::memmott1999, bipartite = TRUE,
directed = FALSE, group_names = c('Animals','Plants'))

# A bipartite network as an igraph object

# Generate a random bipartite network in igraph
g <- igraph::sample_bipartite(10,16,p=0.3, type = 'gnp', directed = TRUE, mode = 'in')
V(g)$name <- letters # name the nodes
V(g)$gender <- sample(c('F','M'), size = 26, replace = TRUE) # Add a node attribute
E(g)$weight=runif(ecount(g)) # Add edge weights
plot(g, layout=layout.bipartite)
create_monolayer_network(g, group_names = c('Parasites','Hosts'))





Create Multilayer Network

Description

This function creates a multilayer network from multiple matrices / link lists.

Usage

create_multilayer_network(
  list_of_layers,
  bipartite,
  directed,
  interlayer_links = NULL,
  layer_attributes = NULL,
  state_node_attributes = NULL,
  physical_node_attributes = NULL
)

Arguments

list_of_layers

List of matrices or list of link lists (format from to weight; see description). These are the intralayer links.

bipartite

Is the network bipartite? Must be provided (no default value).

directed

Is the network directed? Must be provided (no default value).

interlayer_links

Interlayer extended edge list of the format layer_from node_from layer_to node_to weight. Default is NULL, assuming no interlayer links.

layer_attributes

Optional. A data frame with layer attributes. The first column must be called layer_id, and it must have unique values (one row per layer). Layer name column, if exists must be called layer_name, and its values must be unique. The order of the rows and layer_id should be the same as in list_of_layers. No column is allowed to be named name.

state_node_attributes

Optional. Additional information on physical nodes in layers. Must contain columns layer_name and node_name.

physical_node_attributes

Optional. Additional information on physical nodes. Must contain column node_name.

Details

Input of list_of_layers is handled by the function create_monolayer_network; see it's description for details on input. If using matrices as input, they should contain row and column names. If link lists are provided as input column names should be from to weight.

When using link lists, it is possible to include link attributes. In that case the headers of all the link lists and, if included, the interlayer links, must be the same (after the weight), even if some attributes are included in only some layers (see detailed example in the code accompanying the package). Missing link attributes can be set to NA.

If interlayer links are provided, then layer_attributes must also be provided. Specify layer and nodes by UNIQUE names (not IDs). Layer names should correspond to those provided in layer_attributes.

Attributes of state nodes can be provided with state_node_attributes. If provided, then columns layer_name and node_name must be included.

For compatibility with function load_emln the output contains description and references. The value of any missing data frames in the multilayer object will be set to NULL.

See multiple example in the code accompanying the package

Value

A multilayer object (see ?multilayer).

See Also

multilayer, create_monolayer_network

Examples

library(tibble)
pond_1 <- matrix(c(0,1,1,0,0,1,0,0,0), byrow = TRUE,
nrow = 3, ncol = 3, dimnames = list(c('pelican','fish','crab'),
c('pelican','fish','crab')))
pond_2 <- matrix(c(0,1,0,0,0,1,0,0,0), byrow = TRUE,
nrow = 3, ncol = 3, dimnames = list(c('pelican','fish','crab'),
c('pelican','fish','crab')))
pond_3 <- matrix(c(0,1,1,0,0,1,0,0,0), byrow = TRUE,
nrow = 3, ncol = 3, dimnames = list(c('pelican','fish','tadpole'),
c('pelican','fish','tadpole')))

layer_attrib <- tibble(layer_id=1:3,
                       layer_name=c('pond_1','pond_2','pond_3'),
                       location=c('valley','mid-elevation','uphill'))

# Create the ELL tibble with interlayer links.
interlayer <- tibble(layer_from=c('pond_1','pond_1','pond_1'),
                     node_from=c('pelican','crab','pelican'),
                     layer_to=c('pond_2','pond_2','pond_3'),
                    node_to=c('pelican','crab','pelican'),
                     weight=1)

# This is a directed network so the links should go both ways,
# even though they are symmetric.
interlayer_2 <- interlayer[,c(3,4,1,2,5)]
names(interlayer_2) <- names(interlayer)
interlayer <- rbind(interlayer, interlayer_2)

multilayer <- create_multilayer_network(list_of_layers =
list(pond_1, pond_2, pond_3), layer_attributes = layer_attrib,
interlayer_links = interlayer, bipartite = FALSE, directed = TRUE)


View the data sets

Description

@format Data set of multilayer networks

Usage

descriptions

Format

An object of class tbl_df (inherits from tbl, data.frame) with 89 rows and 10 columns.

Details

@source create

@examples data(descriptions)


emln10_environment_temporal_parker_huryn_2006

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
10 Environment, Temporal 141 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln11_environment_thompson_townsend_2004

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
11 Environment 154 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln12_environment_fryer_1959

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
12 Environment 94 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln13_multiplex_kefi_2016

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
13 Multiplex Food-Web FALSE

Source

Dryad

https://datadryad.org/stash/dataset/doi:10.5061/dryad.b4vg0


emln14_multiplex_mello_2019

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
14 Multiplex Seed-Dispersal FALSE

Source

Web_of_Life

http://www.web-of-life.es


emln15_environment_petipa_1970

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
15 Environment 50 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln16_multiplex_pocock_2012

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
16 Multiplex Multiple FALSE

Source

Dryad

https://datadryad.org/stash/dataset/doi:10.5061/dryad.3s36r118


emln17_multiplex_traveset_2020

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
17 Multiplex Multiple FALSE

Source

Figshare

https://doi.org/10.6084/m9.figshare.c.5208546.v1


emln18_perturbation_stewart_sprules_2011

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
18 Perturbation 160 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln19_spatial_angelini

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
19 Spatial Food-Web FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln1_environment_schleuning_2010

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
1 Environment Seed-Dispersal FALSE

Source

Interaction_Web_DataBase

http://www.ecologia.ib.usp.br/iwdb/html/schleuning-et-al-2010.html


emln20_spatial_angelini_2013

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
20 Spatial Food-Web FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln21_spatial_arroyo_1982

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
21 Spatial Pollination FALSE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.web-of-life.es/map.php

http://www.ecologia.ib.usp.br/iwdb/html/arroyo_1982.html


emln22_spatial_beaver_1985

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
22 Spatial 86 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln23_spatial_canadian_fish_parasite

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
23 Spatial Host-Parasite TRUE

Source

Interaction_Web_DataBase

http://www.ecologia.ib.usp.br/iwdb/html/canadian_fish.html


emln24_spatial_carlo_2003

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
24 Spatial Seed-Dispersal FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln25_spatial_carstensen_2014

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
25 Spatial Pollination FALSE

Source

figshare

https://figshare.com/articles/dataset/Beta_Diversity_of_Plant_Pollinator_Networks_and_the_Spatial_Turnover_of_Pairwise_Interactions/1234708


emln26_spatial_chacoff_2020

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
26 Spatial Pollination FALSE

Source

Dryad

https://datadryad.org/stash/dataset/doi:10.5061/dryad.8cz8w9gm1


emln27_spatial_dexter_1947

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
27 Spatial 54 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln28_spatial_dicks_2002

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
28 Spatial Pollination TRUE

Source

Web_of_Life

http://www.web-of-life.es/map.php?type=6


emln29_spatial_dupont_olesen_2009

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
29 Spatial Pollination FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln2_environment_benadi_jae_2013

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
2 Environment Pollination FALSE

Source

Dryad

https://datadryad.org/stash/dataset/doi:10.5061/dryad.8mn44


emln30_spatial_elberling_1999

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
30 Spatial Pollination TRUE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.web-of-life.es/map.php?type=6

http://www.ecologia.ib.usp.br/iwdb/


emln31_spatial_environment_cornaby_1974

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
31 Spatial , Environment 90 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln32_spatial_environment_mckinnerney_1978

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
32 Spatial , Environment 148 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln33_spatial_hadfield_2013

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
33 Spatial Host-Parasite TRUE

Source

Web_of_Life

Dryad

http://www.web-of-life.es/map.php

https://datadryad.org/stash/dataset/doi:10.5061/dryad.jf3tj


emln34_spatial_havens_1992

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
34 Spatial 15 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln35_spatial_ingversen_2006

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
35 Spatial Pollination FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln36_spatial_joern_1979

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
36 Spatial Plant-Herbivore TRUE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.web-of-life.es/map.php?type=6

http://www.ecologia.ib.usp.br/iwdb/html/joern_1979.htm


emln37_spatial_jordano_unpubl

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
37 Spatial Seed-Dispersal FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln38_spatial_kyoto

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
38 Spatial Pollination FALSE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.web-of-life.es/map.php

http://www.ecologia.ib.usp.br/iwdb/resources.html


emln39_spatial_leather_1991

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
39 Spatial Plant-Herbivore TRUE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.web-of-life.es/map.php

http://www.ecologia.ib.usp.br/iwdb/html/leather_1991.htm


emln3_environment_bird_1930

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
3 Environment 87 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln40_spatial_medan_2002

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
40 Spatial Pollination FALSE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.ecologia.ib.usp.br/iwdb/html/medan_et_al_2002.html

http://www.web-of-life.es/map.php


emln41_spatial_melian_2015

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
41 Spatial Food-Web FALSE

Source

Dryad

https://datadryad.org/stash/dataset/doi:10.5061/dryad.06bb5


emln42_spatial_menge_sutherland_1976

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
42 Spatial 104 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln43_spatial_montero_2005

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
43 Spatial Pollination TRUE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln44_spatial_olesen_2003

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
44 Spatial Pollination FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln45_spatial_olesen_2002

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
45 Spatial 61 Pollination FALSE

Source

mangal

https://mangal.io/doc/api/


emln46_spatial_p_jordano_unpubl

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
46 Spatial Seed-Dispersal FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln47_spatial_paine_1963

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
47 Spatial 110 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln48_environment_perturbation_bartomeus_2008

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
48 Environment , Perturbation Pollination FALSE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.ecologia.ib.usp.br/iwdb/html/bartomeus_2008.html

http://www.web-of-life.es/map.php


emln49_spatial_perturbation_vazquez_2002

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
49 Spatial , Perturbation Pollination FALSE

Source

Interaction_Web_DataBase

http://www.ecologia.ib.usp.br/iwdb/html/vazquez_2002.html


emln4_environment_hawkins_goeden_1984

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
4 Environment 145 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln50_spatial_poulin_1999

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
50 Spatial Seed-Dispersal FALSE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.web-of-life.es/map.php

http://www.ecologia.ib.usp.br/iwdb/resources.html


emln51_spatial_primack_1983

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
51 Spatial Pollination TRUE

Source

Web_of_Life

http://www.web-of-life.es


emln52_spatial_ricciardi_2010

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
52 Spatial 74 Anemone-Fish FALSE

Source

mangal

https://mangal.io/doc/api/


emln53_spatial_slovakia

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
53 Spatial Host-Parasite FALSE

Source

NA

NA


emln54_spatial_snow b_k_&snow_1988

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
54 Spatial Pollination TRUE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.ecologia.ib.usp.br/iwdb/html/snow_snow_1971.htm

http://www.web-of-life.es/map.php?type=6


emln55_spatial_temporal_alcorlo_2001

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
55 Spatial , Temporal 81 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln56_spatial_temporal_closs_1994

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
56 Spatial , Temporal 49 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln57_spatial_temporal_kolpelke_2017

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
57 Spatial , Temporal 6 Host-Parasite FALSE

Source

mangal

https://mangal.io/doc/api/


emln58_spatial_temporal_martins_2020

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
58 Spatial , Temporal Plant-Herbivore TRUE

Source

Dryad

https://doi.org/10.5061/dryad.vmcvdncq0


emln59_spatial_thompson_2003

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
59 Spatial Food-Web FALSE

Source

Web_of_Life

http://www.web-of-life.es/map.php


emln5_environment_jones_1949

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
5 Environment 99 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln60_spatial_trojelsgaard_2015

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
60 Spatial Pollination FALSE

Source

Dryad

https://datadryad.org/stash/dataset/doi:10.5061/dryad.76173


emln61_spatial_yanez_1978

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
61 Spatial 53 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln62_temporal_angelini_2006

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
62 Temporal 84 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln63_temporal_brodeur_1992

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
63 Temporal 55 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln64_temporal_caradona_2020

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
64 Temporal Pollination FALSE

Source

EDI_data_portal

https://portal.edirepository.org/nis/mapbrowse?packageid=edi.512.1


emln65_temporal_chacoff_2020

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
65 Temporal Pollination FALSE

Source

Dryad

https://datadryad.org/stash/dataset/doi:10.5061/dryad.8cz8w9gm1


emln66_temporal_cohen_2003

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
66 Temporal 153 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln67_temporal_douglas_2011

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
67 Temporal 78 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln68_temporal_environment_baeta_2011

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
68 Temporal , Environment 73 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln69_temporal_fang_2012

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
69 Temporal Pollination FALSE

Source

web

https://figshare.com/articles/dataset/Relative_Stability_of_Core_Groups_in_Pollination_Networks_in_a_Biodiversity_Hotspot_over_Four_Years/127797


emln6_environment_kohler_2011

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
6 Environment Pollination TRUE

Source

Web_of_Life

Interaction_Web_DataBase

http://www.web-of-life.es/map.php?type=6

http://www.ecologia.ib.usp.br/iwdb/html/schleuning-et-al-2010.html


emln70_temporal_mayse_price_1978

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
70 Temporal 158 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln71_temporal_perturbation_kaiser_bunbury_2009

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
71 Temporal , Perturbation Pollination FALSE

Source

Interaction_Web_DataBase

Web_of_Life

http://www.ecologia.ib.usp.br/iwdb/html/kaiser-bunbury_2009.html

http://www.web-of-life.es/map.php


emln72_temporal_ponisio_2017

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
72 Temporal 75 Pollination FALSE

Source

mangal

https://mangal.io/doc/api/


emln73_temporal_ramos_robles_2016

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
73 Temporal Seed-Dispersal FALSE

Source

PeerJ

https://peerj.com/articles/2048/#supplemental-information


emln74_temporal_ruzicka_2012

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
74 Temporal 79 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln75_temporal_schoenly_reid_1983

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
75 Temporal 149 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln76_temporal_tavares_cromar_1996

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
76 Temporal 155 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln77_temporal_vaiela_1974

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
77 Temporal 123 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln78_temporal_zackenberg_2013

Description

Network Description:

network_id multilayer_network_type ecological_network_type state_nodes
78 Temporal Pollination FALSE

Source

plos

https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0081694


emln7_environment_rejmanek_stary_1979

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
7 Environment 112 Host-Parasite FALSE

Source

mangal

https://mangal.io/doc/api/


emln8_environment_savely_1939

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
8 Environment 114 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


emln9_environment_seifert_1976

Description

Network Description:

network_id multilayer_network_type mangal_code ecological_network_type state_nodes
9 Environment 117 Food-Web FALSE

Source

mangal

https://mangal.io/doc/api/


Convert a multilayer class to a a list of igraph objects

Description

This function creates a list of igraph objects from the network layers. Interlayer links are not included.

Usage

get_igraph(multilayer, bipartite, directed)

Arguments

multilayer

The multilayer object.

bipartite

Is the network bipartite? Must be provided (no default value).

directed

Is the network directed? Must be provided (no default value).

Details

If link, physical node or state node attributes are included in the multilayer network they are passed to the igraph objects.

Value

A list:

Examples


# See examples in:
# https://emln.ecomplab.com/multilayer.html#To_igraph_objects


Convert a multilayer class to a supra-adjacency matrix

Description

This function creates a supra-adjacency matrix from a multilayer object.

Usage

get_sam(
  multilayer,
  bipartite,
  directed,
  sparse = FALSE,
  remove_zero_rows_cols = FALSE
)

Arguments

multilayer

The multilayer object.

bipartite

Is the network bipartite? Must be provided (no default value).

directed

Is the network directed? Must be provided (no default value).

sparse

Should the returned matrix be a sparse matrix (class Matrix)? Defaults to false.

remove_zero_rows_cols

Should rows and columns that sum to 0 be removed? Defaults to false.

Details

By default, a SAM contains all the nodes in all the layers. However, not all nodes always occur in all layers. This will be reflected in the state_nodes_map: When layer and node ids are NA that means that the node did not occur in the layer.

A node may not have links across all the layers. In that case, its row or column sum will be zero. This can happen in a directed matrix (see toy example for unipartite network), or in diagonally-coupled networks (see toy bipartite example). The user can choose to remove rows and columns that sum to zero by setting remove_zero_rows_cols to TRUE.

Value

A list:

Examples


# See examples in:
# https://emln.ecomplab.com/multilayer.html#To_supra-adjacency_matrices


Edge list to matrix conversion

Description

Convert an edge list to a matrix. Can handle unipartite and bipartite networks.

Usage

list_to_matrix(
  x,
  directed = FALSE,
  bipartite = TRUE,
  group_names = c("set_cols", "set_rows"),
  node_metadata = NULL
)

Arguments

x

An edge list of the format from to weight.

directed

Is the network directed?

bipartite

Is network bipartite?

group_names

For bipartite networks: name of the groups in the columns and rows, respectively (e.g., parasites and hosts).

node_metadata

Following the igraph method of graph_from_data_frame. Must have a column called node_name with names matching those in x.

Details

It is also possible to add node attributes. For this, it uses igraph. The first column in the node_metadata data frame should have the names of the nodes in the edge list.

Value

A monolayer object.

See Also

Functions create_monolayer_network, monolayer and graph_from_data_frame from igraph.

Examples

library(dplyr)
network <- load_emln(17)
nodes <- network$nodes
links<-subset(network$extended_ids %>% filter(layer_from==1), select=c(node_from, node_to, weight))

list_to_matrix(links, directed = TRUE, bipartite = FALSE, node_metadata = nodes)


# See examples in:
# https://emln.ecomplab.com/monolayer.html#Unipartite


Internal function - loads an RData file, and returns it

Description

Internal function - loads an RData file, and returns it

Usage

loadRData(fileName)

Arguments

fileName

file to be downloaded


Load networks include din the package

Description

Load a specific network by specifying its ID.

Usage

load_emln(network_id)

Arguments

network_id

The network ID.

Details

Use the search_emln and view_emln functions to obtain network IDs.

Value

A multilayer object (see ?multilayer).

See Also

multilayer

Examples


load_emln(network_id = 38)



Incidence matrix to edge list conversion

Description

Convert an incidence matrix to an edge list.

Usage

matrix_to_list_bipartite(x, group_names = c("set_cols", "set_rows"))

Arguments

x

An incidence matrix.

group_names

Name of the groups in the columns and rows, respectively (e.g., parasites and hosts).

Details

Assigns column and row names if those do not exist. Cannot handle node attributes/metadata. Always assumes an undirected network.

Value

A monolayer object.

See Also

create_monolayer_network, monolayer

Examples


# See examples in: https://emln.ecomplab.com/monolayer.html#Bipartite

matrix_to_list_bipartite(bipartite::memmott1999, group_names = c('Animals', 'Plants'))


Adjacency matrix to edge list conversion

Description

Convert an adjacency matrix to an edge list.

Usage

matrix_to_list_unipartite(x, directed)

Arguments

x

An adjacency or incidence matrix.

directed

Is the network directed? TRUE/FALSE

Details

Assigns column and row names if those do not exist. Cannot handle node attributes/metadata.

Value

A monolayer object

See Also

create_monolayer_network, monolayer

Examples

# See examples in:
# https://emln.ecomplab.com/monolayer.html#Unipartite

# Generate a matrix with random weighted interactions
x <- matrix(rbinom(100,1,0.6),10,10)
x <- x*round(runif(100,1,5),0)
# run
matrix_to_list_unipartite(x, directed = TRUE)


An object of class monolayer

Description

A network object of class monolayer contains all the necessary information and R objects to perform future analyses on a monolayer network, and in particular analyses using Infomap.

Value

A list with:

See Also

list_to_matrix, matrix_to_list_unipartite, matrix_to_list_bipartite, create_network_object


An object of class multilayer

Description

A network object of class multilayer contains all the necessary information and R objects that define a multilayer network.

Value

A list with:

See Also

create_multilayer_network


Export a multilayer network to CSV files

Description

Writes an EMLN multilayer object as the three-file CSV set consumed by the Multilayer Network Visualizer's CSV importer.

Usage

multilayer_to_csv(
  multilayer,
  dir,
  prefix = "network",
  bipartite = FALSE,
  directed = NULL
)

Arguments

multilayer

A multilayer object (created by create_multilayer_network or load_emln).

dir

Directory to write the CSV files to. Created if it does not already exist.

prefix

Character. File name prefix. Defaults to "network". Three files are always written: <prefix>_edges.csv, <prefix>_layers.csv, <prefix>_nodes.csv. A fourth file <prefix>_state_nodes.csv is written when the multilayer object contains per-(layer, node) attributes beyond layer_name and node_name (e.g. abundance, module).

bipartite

Logical. Whether the network is bipartite. Defaults to FALSE. When TRUE, the nodes table must contain a node_type (or legacy node_group) column with exactly two distinct values across the network, and a bipartite column is written to the layers CSV.

directed

Logical or NULL. Whether the network is directed. If NULL (default), auto-detected by checking intralayer edge symmetry.

Details

The CSV files follow the schema accepted by the visualizer's CSV importer:

The directed flag is not written to the CSV files; it is a property you specify in the visualizer's CSV import dialog at load time.

Value

Invisibly returns a named character vector of file paths written (edges, layers, nodes, and optionally state_nodes).

Note

The Multilayer Network Visualizer that this function targets is currently in beta. Feedback and bug reports are welcome at https://github.com/Ecological-Complexity-Lab/emln/issues.

See Also

multilayer_to_json, plot_multilayer

Examples


net <- load_emln(14)
multilayer_to_csv(net, dir = "tests/out/", prefix = "kefi", bipartite = TRUE)


Export a multilayer network to JSON

Description

Converts an EMLN multilayer object to JSON format compatible with the Multilayer Network Visualizer web app.

Usage

multilayer_to_json(multilayer, file = NULL, bipartite = FALSE, directed = NULL)

Arguments

multilayer

A multilayer object (created by create_multilayer_network or load_emln).

file

Optional file path to write the JSON to. If NULL, returns the JSON string.

bipartite

Logical. Whether the network is bipartite. Defaults to FALSE. The visualizer no longer auto-detects bipartite structure — you must set this to TRUE explicitly. When TRUE, the nodes table must contain a node_type (or legacy node_group) column with exactly two distinct values across the network. Any node_group column is renamed to node_type in the output regardless of the bipartite flag (canonical name for the visualizer).

directed

Logical or NULL. Whether the network is directed. If NULL (default), auto-detected by checking edge list symmetry.

Details

The JSON output contains four arrays matching the visualizer's expected format:

Value

If file is NULL, returns the JSON string invisibly. If file is specified, writes JSON to disk and returns the file path invisibly.

Note

The Multilayer Network Visualizer that this function targets is currently in beta. Feedback and bug reports are welcome at https://github.com/Ecological-Complexity-Lab/emln/issues.

See Also

plot_multilayer, create_multilayer_network, load_emln

Examples


# Export to file
net <- load_emln(14)
multilayer_to_json(net, file = "tests/my_network.json", bipartite = TRUE)

# Get JSON string
json_str <- multilayer_to_json(net)


Plot a multilayer network in the browser

Description

Converts an EMLN multilayer object to JSON and opens the Multilayer Network Visualizer in the default web browser.

Usage

plot_multilayer(
  multilayer,
  bipartite = FALSE,
  directed = NULL,
  port = 8080,
  viz_path = NULL,
  browser = getOption("browser")
)

Arguments

multilayer

A multilayer object (created by create_multilayer_network or load_emln).

bipartite

Logical. Whether the network is bipartite. Defaults to FALSE. Bipartite is not auto-detected. When TRUE, the nodes table must contain a node_type (or legacy node_group) column with exactly two distinct values across the network.

directed

Logical or NULL. Whether the network is directed. If NULL (default), auto-detected by checking intralayer edge symmetry.

port

Integer. Port for the local HTTP server. Default is 8080.

viz_path

Character. Path to the multilayer_viz directory. If NULL (default), uses the viz directory bundled with the package.

browser

Choose the specific browser to open the visualizer. Defaults to the system default via getOption("browser"). Can be a browser name (e.g. "chrome", "firefox") or a command (e.g. "open -a 'Google Chrome'").

Details

The function:

  1. Converts the multilayer object to JSON via multilayer_to_json

  2. Starts a local HTTP server (using httpuv) that serves the visualizer app and the network JSON

  3. Opens the browser with auto-load enabled

The server runs in the background. Call httpuv::stopServer(handle) or close R to stop it. The JSON data is kept in memory and never written to disk.

Value

Invisibly returns the server handle. Use httpuv::stopServer(handle) to stop the server when done.

Note

The Multilayer Network Visualizer that this function targets is currently in beta. Feedback and bug reports are welcome at https://github.com/Ecological-Complexity-Lab/emln/issues.

See Also

multilayer_to_json, create_multilayer_network, load_emln

Examples

if (interactive()){
net <- load_emln(60)
srv <- plot_multilayer(net, bipartite = TRUE)

# When done:
httpuv::stopServer(srv)
}

Search networks

Description

Search the database for networks depending on search parameters specified below.

Usage

search_emln(
  ecological_network_type = NULL,
  multilayer_network_type = NULL,
  state_nodes = NULL,
  node_number_minimum = NULL,
  layer_number_minimum = NULL,
  weighted = NULL,
  interlayer = NULL,
  directed = NULL
)

Arguments

ecological_network_type

One of: Seed-Dispersal, Pollination, Food-Web, Host-Parasite, Multiple, Plant-Herbivore, Anemone-Fish, Plant-Ant

multilayer_network_type

Environment, Temporal, Multiplex, Perturbation, Spatial

state_nodes

TRUE/FALSE

node_number_minimum

The minimum number of layers wanted in the network

layer_number_minimum

The minimum number of layers wanted in the network

weighted

TRUE/FALSE

interlayer

TRUE/FALSE

directed

TRUE/FALSE

Value

A tibble containing the network id, and all the search arguments for each of the networks that are compatible with the search.

Examples

# See examples in:
# https://emln.ecomplab.com/data.html#Browsing_the_data

# Generates a tibble of all the networks in the package that are pollination networks
search_emln(ecological_network_type = 'Plant-Ant')

# Generates a tibble of all the networks in the package that have state nodes and are temporal
search_emln(multilayer_network_type = 'Temporal', state_node = TRUE)


View networks

Description

View the database interactively.

Usage

view_emln()

Value

An interactive GUI for browinsg through networks.