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.
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 or 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.
Returns
No return value, called for side effects.
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).
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 fitplot_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 sizesplot_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)
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.