generate_edgelist: Export null modelling results

Description Usage Arguments Value References See Also Examples

Description

Exports the observed network alongside the mean interaction strengths calculated from the null model and the significance test results in a standard format that can be imported into other network analysis packages e.g. igraph (Csardi & Nepusz 2006) or cheddar (Hudson et al. 2013). This provides access to a wide range of plotting and analysis tools, especially for non-bipartite networks.

Usage

1
2
generate_edgelist(nullnet, signif.level = 0.95, export.null = FALSE,
  edge.cols = c("#67A9CF", "#F7F7F7", "#EF8A62"))

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

export.null

An optional logical value specifying whether export should be limited to those interactions that were present in the observed network or should include any additional interactions present across iterations of the null network. Depending upon the data and any forbidden links specified, additional interactions may be present in the modelled networks. Defaults to FALSE (only observed interactions are exported).

edge.cols

An optional character vector of length three specifying potential colours for network links when used with a suitable plotting function: in sequence, these should represent i) interactions that are weaker than expected, ii) consistent with the null model and iii) stronger than expected. The default is a colourblind friendly blue, white and red scheme, using Colorbrewer's Red-Blue colour scheme (Brewer 2017).

Value

A data frame where each row represents the interaction observed between a pair of consumer and resource species, and with the following column headings:

Consumer

Name of the consumer species (node)

Resource

Name of the resource species (node)

Observed

Strength of the observed interaction

Null

Mean strength of the interaction across the iterations of the null model

SES

The standardised effect size for the interaction

Test

Whether the observed interaction is significantly stronger than expected under the null model, weaker or consistent with the null model ns

References

Brewer, C.A. (2017) http://www.ColorBrewer.org

Csardi, G. & Nepusz, T. (2006) The igraph software package for complex network research. InterJournal, Complex Systems, 1695.

Hudson, L.N., Emerson, R., Jenkins, G.B., Layer, K., Ledger, M.E., Pichler, D.E., Thompson, M.S.A., O'Gorman, E.J., Woodward, G & Reuman, D.C. (2013) Cheddar: analysis and visualisation of ecological communities in R. Methods in Ecology and Evolution, 4, 99–104.

Vaughan, I.P., Gotelli, N.J., Memmott, J., Pearson, C.E., Woodward, G. and Symondson, W.O.C. (2017) nullnetr: an R package using null models to analyse the structure of ecological networks and identify resource selection (submitted)

See Also

generate_null_net

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set.seed(1234)
bs.null <- generate_null_net(Broadstone, Broadstone.prey, data.type = "counts",
                             sims = 10, r.weights = Broadstone.fl)
BS.export <- generate_edgelist(bs.null, signif.level = 0.95)

# Plot network with functions from the cheddar package
library(cheddar)
BS.comm <- list(title = "Broadstone, August", M.units = "mg",
                N.units = "counts")

# Change to lower case to match cheddar convention, then create an object
#  of class 'community'
colnames(BS.export)[1:2] <- c("consumer", "resource")
BS <- Community(nodes = Broadstone.nodes, properties = BS.comm,
                trophic.links = BS.export)

PlotWebByLevel(BS, link.colour.by = "Test", link.colour.spec = c(Stronger =
               "#d7191c", ns = "#cccccc", Weaker = "#2c7bb6"),
               link.lwd = log(TLPS(BS)$Observed), pch = 16, cex = 3,
               col = "black", highlight.nodes = NULL,
               show.nodes.as = "both", label.cex = 1, label.colour = "white")
legend("topright", legend = c("Stronger", "ns", "Weaker"), lty = 1, lwd = 2,
       col = c("#d7191c", "#cccccc", "#2c7bb6"))

ivaughan/nullnetr documentation built on May 12, 2019, 2 p.m.