Learn R Programming

bipartite (version 0.90)

plotweb: Visualize a bipartite interaction matrix (e.g. a foodweb)

Description

A two dimensional matrix is plotted as a bipartite graph.

Usage

plotweb(web, method = "cca", empty = TRUE, labsize = 1, ybig = 1,
    y_width = 0.1, spacing = 0.05, arrow="no", col.interaction="grey80",
    col.pred = "grey10", col.prey="grey10", lab.space=1,
    bor.col.interaction ="black", bor.col.pred="black", bor.col.prey="black",
    lablength = NULL, sequence=NULL, low.abun=NULL, low.abun.col="green",
    bor.low.abun.col ="black", 
    high.abun=NULL, high.abun.col="red", bor.high.abun.col="black",
    text.rot=0, text.high.col="black", text.low.col="black")

Arguments

web
Web is a matrix representing the interactions observed between higher trophic level species (columns) and lower trophic level species (rows). Usually this will be number of pollinators on each species of plants or number of parasitoids on each species of
method
Default method is , which leads to as few crossings of interactions as possible. The other option is , which leaves order as given by the matrix.
empty
logical; should empty columns or empty rows be omitted from plotting; defaults to true
labsize
factor for size of labels, default is 1
ybig
vertical distance between upper and lower boxes, default is 1
y_width
width of upper and lower boxes, default is 0.1
spacing
horizonatal distance between upper and lower boxes, default is 0.05
arrow
display type of connection between upper and lower boxes, options are , , , , , and , defaul
col.interaction
color of interaction, default is grey80.
col.pred
color of upper boxes, default is grey10.
col.prey
color of lower boxes, default is grey10.
lab.space
sometimes it is neccessary to add additional space for labels below und above of the boxes, so all labes are shown, default is 1.
bor.col.interaction
border color of interaction, default is black
bor.col.pred
border color of upper boxes, default is black
bor.col.prey
border color of lower boxes, default is black
lablength
number of characters of labels that should be plotted. If zero no labels are shown, default is NULL which plots the complete labels.
sequence
list of two with two names vectors: seq.pred and seq.prey, which specify the order in which species are plotted. Cannot be set for . Defaults to NULL, where the sequence remains as given
low.abun
Vector with independent abundance estimates for the lower trophic level, NULL if none exists.
low.abun.col
Colour for depicting the abundance estimates for the lower trophic level; defaults to green.
bor.low.abun.col
border color for depicting the abundance estimates for the lower trophic level, default is black
high.abun
Vector with independent abundance estimates for the higher trophic level, NULL if none exists.
high.abun.col
Colour for depicting the abundance estimates for the lower trophic level; defaults to red.
bor.high.abun.col
border color for depicting the abundance estimates for the higher trophic level, default is black
text.rot
orientation of labels in the plot (to avoid overlapping of horizontal labels if dimension of the webs are high), default is 0 for horizontal labels, use text.rot=90 for vertical labels.
text.high.col
Colour for text labels of higher trophic level, a vector of colours can be given
text.low.col
Colour for text labels of lower trophic level. A vector of colours can be given

Value

  • Returns a window with a bipartite graph of a foodweb. For all colours vectors can be used (which are recycled if length differs.

encoding

latin1

References

Tylianakis, J. M., Tscharntke, T. and Lewis, O. T. (2007) Habitat modification alters the structure of tropical host-parasitoid food webs. Nature 445, 202--205

See Also

For a different plot of foodwebs see visweb

Examples

Run this code
data(Safariland)
plotweb(Safariland)

# shorter labels
plotweb(Safariland, lablength=3, arrow="down")

# centered triangles for displaying interacions
plotweb(Safariland, text.rot=90, arrow="down.center", col.interaction="wheat2")

#orginal sequence, up arrows and different box width
plotweb(Safariland, method="normal", arrow="up", y_width=0.3, lablength=4)
# interactions as lines
plotweb(Safariland, arrow="both", y_width=0.05, text.rot=90, col.pred="blue", col.prey="green")

# add an abundance vector for lower trophic species 
low.abun = round(runif(dim(Safariland)[1],1,40)) #create
names(low.abun) <- rownames(Safariland)
plotweb(Safariland, text.rot=90, low.abun=low.abun, col.interaction="purple", y_width=0.05)

plotweb(Safariland, text.rot=90, low.abun=low.abun, col.interaction ="red", bor.col.interaction="red", arrow="down")

# now vectors for all colours can be given, to mark certain species or interactions. Colour vectors are recycled if not of appropriate length
plotweb(Safariland,col.pred=c("orange","green"))
plotweb(Safariland,col.pred=c("orange","green"),col.prey=c("white","grey","purple"),text.high.col=c("blue","red"), col.interaction=c("red",rep("green",26),rep("brown",242)), bor.col.interaction=c(rep("green",26),rep("brown",242)),method="normal", text.rot=90, lablength=10)

Run the code above in your browser using DataLab