plot_preferences {econullnetr} | R Documentation |
Plot the resource preferences of a consumer
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
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 |
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 or bar chart is
plotted. The default ( |
type |
Optional string to specify how preferences are displayed. The
default ( |
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
|
l.cex |
An optional numeric value to set the size of the labels when
using |
p.cex |
An optional numeric value to set the size of the points when
when using |
... |
Other arguments to control basic plotting functions in R, such as
|
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).
Value
No return value, called for side effects.
References
Brewer, C.A. (2017) https://colorbrewer2.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. & 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
, plot_bipartite
Examples
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)
op <- 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")
par(op)
# Same results, this time showing the standardised effect sizes
plot_preferences(null.1, "Rhyacophila", signif.level = 0.95,
type = "SES", xlab = "SES")
op <- par(mar = c(9, 4, 4, 2) + 0.1)
plot_preferences(null.1, "Rhyacophila", signif.level = 0.95, style = "bars",
type = "SES", ylab = "SES")
par(op)