Learn R Programming

econullnetr (version 0.2.2)

plot_bipartite: Plot a bipartite network, colour coding individual links according to whether they are stronger or weaker than expected under the null model

Description

Acts as a wrapper for the bipartite package's plotweb function (Dormann et al., 2008), colour coding the links in the familiar bipartite plots according to whether they are stronger, weaker or consistent with the null model. Following revisions to plotweb in bipartite v2.22, this currently uses the older version of this function, now called plotweb_deprecated.

Usage

plot_bipartite(
  nullnet,
  signif.level = 0.95,
  edge.cols = c("#67A9CF", "#F7F7F7", "#EF8A62"),
  ...
)

Value

No return value, called for side effects.

Arguments

nullnet

An object of class "nullnet" from generate_null_net

signif.level

An optional value specifying the threshold used for testing for 'significant' deviations from the null model. Defaults to 0.95

edge.cols

An optional character vector of length three specifying the colours for links in the bipartite plot: they should represent interactions that are weaker than expected, consistent with the null model and stronger than expected in that order. The default is a colourblind friendly blue, white and red scheme, using colorbrewer's Red-Blue colour scheme (Brewer 2017).

...

Other arguments to be supplied to bipartite's plotweb_deprecated function.

Details

Extensive options can be passed to plotweb_deprecated to customise the network plot beyond the colour coding of the links. See the appropriate help file in the bipartite package for details.

References

Brewer, C.A. (2017) https://colorbrewer2.org/

Dormann, C.F., Gruber B. & Frund, J. (2008). Introducing the bipartite package: analysing ecological networks. R news, 8, 8-11.

Vaughan, I.P., Gotelli, N.J., Memmott, J., Pearson, C.E., Woodward, G. & Symondson, W.O.C. (2018) econullnetr: an R package using null models to analyse the structure of ecological networks and identify resource selection. Methods in Ecology and Evolution, 9, 728--733.

See Also

generate_null_net, bipartite_stats, plotweb_deprecated

Examples

Run this code

# Run the null model
set.seed(1234)
sil.null <- generate_null_net(Silene[, 2:7], Silene.plants[, 2:6], sims = 10,
                              c.samples = Silene[, 1],
                              r.samples = Silene.plants[, 1])

# Basic plot
plot_bipartite(sil.null)

# With alternative colour scheme and nodes width in the lower level proportional
#  to mean floral abundance
mean.abunds <- colMeans(Silene.plants[, 2:6])
plot_bipartite(sil.null, signif.level = 0.95, edge.cols = c("#67a9cf",
               "#F7F7F7", "#ef8a62"), low.abun = mean.abunds,
               abuns.type = "independent", low.abun.col = "black",
               high.abun.col = "black", high.lablength = 0, low.lablength = 0)

Run the code above in your browser using DataLab