Getting the data into R
Every network can be read straight into R with read.csv(); no package is needed. The files are plain CSV in UTF-8, with species names exactly as in the downloads. The examples use network M_PL_006; replace it with any network ID.
One network
# Interaction matrix, species names as row and column names
m <- as.matrix(read.csv("https://www.web-of-life.es/api/v1/networks/M_PL_006/matrix.csv",
row.names = 1, check.names = FALSE))
# One row per interaction: network, row_species, column_species, row_role, column_role, strength
edges <- read.csv("https://www.web-of-life.es/api/v1/networks/M_PL_006/edges.csv")
# The species: side of the matrix, role, kingdom, order, family, number of interactions, abundance
species <- read.csv("https://www.web-of-life.es/api/v1/networks/M_PL_006/species.csv")
All networks
# One row per network: type, size, connectance, nestedness, modularity, location, reference
networks <- read.csv("https://www.web-of-life.es/api/v1/networks.csv")
# Several networks at once, e.g. all weighted pollination networks
ids <- networks$network[networks$interaction_type == "Pollination" & networks$weighted == 1]
matrices <- lapply(ids, function(id) as.matrix(read.csv(
paste0("https://www.web-of-life.es/api/v1/networks/", id, "/matrix.csv"), row.names = 1, check.names = FALSE)))
names(matrices) <- ids
Everything at once, with one table of all interactions of all networks: download the zip of all published networks.
Files
| Address | Content |
|---|---|
/api/v1/networks.csv | All networks with their metadata and structure. |
/api/v1/networks/<ID>/matrix.csv | The matrix of one network, without abundances. |
/api/v1/networks/<ID>/edges.csv | Its interactions, one per row. |
/api/v1/networks/<ID>/species.csv | Its species with their role and taxonomy. |
/download/everything/ | A zip with all of the above for every published network. |
Earlier addresses
The addresses of the previous site keep working with the same output, for the rweboflife package and existing scripts: get_networks.php, get_network_info.php, get_species_info.php, get_networks_by_species.php, get_taxize_info.php and networkjson.php. For example: https://www.web-of-life.es/get_networks.php?network_name=M_PL_006.
Nestedness and modularity
Nestedness is computed as in rweboflife::nestedness (Fortuna et al. 2019, Evolution 73: 1001–1011), from 0 to 1. Modularity is Barber's bipartite modularity (Physical Review E 76: 066102, 2007) of the binary matrix, maximised by repeated searches; the number of modules is that of the best partition found.
How to cite
Please cite the original study of each network and mention the database: "This work has used the Web of Life database (www.web-of-life.es)". Each network's sheet has a How to cite button with BibTeX and RIS files.