Null Model Analysis for Ecological Networks

Tools for using null models to analyse ecological networks (e.g. food webs, flower-visitation networks, seed-dispersal networks) and detect resource preferences or non-random interactions among network nodes. Tools are provided to run null models, test for and plot preferences, plot and analyse bipartite networks, and export null model results in a form compatible with other network analysis packages. The underlying null model was developed by Agusti et al. (2003) Molecular Ecology and the full application to ecological networks by Vaughan et al. (2018) econullnetr: an R package using null models to analyse the structure of ecological networks and identify resource selection. Methods in Ecology & Evolution, .


econullnetr is a package of functions for analysing ecological networks (e.g. food webs, flower-visitation networks) using null model analysis. The observed network is compared to networks generated by a null model, which assumes that the frequency with which species (nodes in the network) interact with one another is simply a consequence of their relative abundance (i.e. how often they encounter one another). Differences in the structure of observed and simulated networks (e.g. in the interaction strengths between nodes) implies that other mechanisms are involved in structuring the network.

econullnetr has six functions:

  1. generate_null_net() to run null models.
  2. test_interactions() for comparing observed and modelled interactions between species.
  3. plot_preferences() for comparing a consumer species' observed and expected interactions with the resource species.
  4. bipartite_stats() for calculating a broad set of statistics for bipartite networks to compare observed and modelled networks. This draws on the functions from the bipartite package.
  5. plot_bipartite() which is a wrapper for the bipartite package's plotweb() function, superimposing the null model results.
  6. generate_edgelist() to export the null modelling results in a standard format for use with other R packages.

The package also includes three examples, each comprising multiple data sets. See the package vignette and help files for full descriptions of the package's functionality and data sets.


The following example runs a simple null model using one of the example data sets from econullnetr and displays an example of bipartite_stats() output and part of the output table for test_interactions() (shortened for brevity). Full examples covering all of the main functionality are described in the help files and package vignette.

sil.null <- generate_null_net(Silene[, 2:7], Silene.plants[, 2:6], sims = 10,
                             c.samples = Silene[, 1],
                             r.samples = Silene.plants[, 1], prog.count = FALSE)
bipartite_stats(sil.null, index.type = "networklevel",
                indices = c("linkage density", "weighted connectance", 
                            "interaction evenness"), intereven = "sum", 
                prog.count = FALSE)
##                       Observed      Null  Lower.CL  Upper.CL  Test       SES
## linkage density      5.0960242 6.8303241 6.4566289 7.1999193 Lower -6.740767
## weighted connectance 0.1415562 0.1902469 0.1804936 0.1999978 Lower -7.412841
## interaction evenness 0.8489881 0.8991247 0.8765239 0.9104503 Lower -4.482613
# First 10 rows of the output table for inter-specific (inter-node) interactions.
#   When running this code, two warnings will normally be generated to highlight
#   that: i) a very small number of model iterations was used for this example 
#   and ii) there is a large number (155) of individual tests in the full 
#   test_interactions table, so the risk of Type I errors needs to be considered.
test_interactions(sil.null, 0.95)[1:10, ]
##           Consumer             Resource Observed Null Lower.95.CL Upper.95.CL     Test        SES
## 1 Achillea.millefolium        1  0.1           0       0.775 Stronger  2.8460499
## 2   Hypericum.pulchrum        0  0.3           0       1.000       ns -0.6210590
## 3       Papaver.rhoeas        0  0.0           0       0.000       ns         NA
## 4     Senecio.jacobaea        0  0.6           0       1.000       ns -1.1618950
## 5       Silene.gallica        0  0.0           0       0.000       ns         NA
## 6  Bombus.pratorum Achillea.millefolium        0  0.0           0       0.000       ns         NA
## 7  Bombus.pratorum   Hypericum.pulchrum        0  0.1           0       0.775       ns -0.3162278
## 8  Bombus.pratorum       Papaver.rhoeas        0  0.0           0       0.000       ns         NA
## 9  Bombus.pratorum     Senecio.jacobaea        1  0.8           0       1.000       ns  0.4743416
## 10 Bombus.pratorum       Silene.gallica        0  0.1           0       0.775       ns -0.3162278


The development version of econullnetr can be installed from GitHub:

# install.packages("devtools")


econullnetr 0.1.0

  • First release of the package

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.2.1 by Ian Vaughan, 8 months ago

Report a bug at

Browse source code at

Authors: Ian Vaughan

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports reshape2, bipartite, gtools

Suggests igraph, knitr, readr, rmarkdown, testthat, vdiffr

See at CRAN