plot_preferences: Plot the resource preferences of a consumer

Description Usage Arguments Details References See Also Examples

Description

Takes a 'nullnet' object from running a null model with generate_null_net and plots the observed and expected link strengths for every resource for a selected consumer species (node in the network). There are two styles of plot: the default is a dot plot based on dotchart, whilst the alternative is a bar plot based on barplot. There are arguments in plot_preferences to set some of the graphical parameters, but see the respective help files for dotchart and barplot for further options to customise the plots.

Usage

1
2
3
plot_preferences(nullnet, node, signif.level = 0.95, style = "dots",
  type = "counts", res.col = c("#67A9CF", "#F7F7F7", "#EF8A62"),
  res.order = NULL, l.cex = 1, p.cex = 1, ...)

Arguments

nullnet

An object of class nullnet from generate_null_net

node

A string specifying the consumer node (species) whose preferences will be plotted

signif.level

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

style

An optional string to set whether a dotchart of bar chart is plotted. The default (style = "dots") is a Cleveland dot plot, whilst the alternative (style = "bars") is a bar chart of the type used by King et al. (2010) and Davey et al. (2013).

type

Optional string to specify how preferences are displayed. The default (type = "counts") is the total number of interactions or mean interaction strength, depending upon which one was requested in the original call to generate_null_net using the summary.type argument. The alternative is the standardised effect size (type = "SES"). With type = "counts", confidence limits will be drawn, whilst for the standardised effect size, dashed lines are added at +2 and -2, which is approximately equivalent to a 5% significance level: fill colours for type = "SES" are based on the estimated confidence limits, rather than the +2/-2 thresholds.

res.col

An optional character vector of length three specifying the colours with which to fill the dots or bars representing interactions that are weaker than expected, consistent with the null model and stronger than expected (in that order). The default is a red-blue colour scheme.

res.order

An optional data frame used to set the order in which the resource species are plotted. Should have two columns: the first listing the resource species (names must be identical to those used by generate_null_net) and the second the plotting order (bars will be plotted in ascending order)

l.cex

An optional numeric value to set the size of the labels when using style = "dots". Ignored when style = "bars", as barplot's cex.names argument can be used.

p.cex

An optional numeric value to set the size of the points when when using style = "dots".

...

Other arguments to control basic plotting functions in R, such as lwd, xlab, ylab, main, xlim and ylim.

Details

Plots the preferences for individual consumer species. The bar plot format follows the basic style of King et al. (2010; Figure 3) and Davey et al. (2013; Figure 3).

References

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

Davey, J.S., Vaughan, I.P., King, R.A., Bell, J.R., Bohan, D.A., Bruford, M.W., Holland, J.M. & Symondson, W.O.C. (2013) Intraguild predation in winter wheat: prey choice by a common epigeal carabid consuming spiders. Journal of Applied Ecology, 50, 271–279.

King, R.A, Vaughan, I.P., Bell, J.R., Bohan, D.A, & Symondson, W.O.C. (2010) Prey choice by carabid beetles feeding on an earthworm community analysed using species- and lineage-specific PCR primers. Molecular Ecology, 19, 1721–1732.

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, plot_bipartite

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
null.1 <- generate_null_net(WelshStreams[, 2:18], WelshStreams.prey[, 2:17],
                            sims = 10, c.samples = WelshStreams[, 1],
                            r.samples = WelshStreams.prey[, 1])
# Basic plots, showing the dot and bar plot styles. Increased lower margin
#   on the bar plot so that names fit
plot_preferences(null.1, "Dinocras", signif.level = 0.95, type = "counts",
                 xlab = "Num. of visits", p.cex = 1.2, lwd = 2)

par(mar = c(9, 4, 4, 2) + 0.1)
plot_preferences(null.1, "Dinocras", style = "bars", signif.level = 0.95,
                 type = "counts", ylab = "Num. of visits")

# Same results, this time showing the standardised effect sizes
plot_preferences(null.1, "Rhyacophila", signif.level = 0.95,
                 type = "SES", xlab = "SES")
par(mar = c(9, 4, 4, 2) + 0.1)
plot_preferences(null.1, "Rhyacophila", signif.level = 0.95, style = "bars",
                 type = "SES", ylab = "SES")

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