Learn R Programming

analogue (version 0.10-0)

caterpillarPlot: Caterpillar plot of species' WA optima and tolerance range.

Description

Draws a caterpillar plot of the weighted average optima and tolerance range for each of the species in a data set.

Usage

## S3 method for class 'default':
caterpillarPlot(x, tol, mult = 1, decreasing = TRUE,
                labels, xlab = NULL, pch = 21, bg = "white",
                col = "black", lcol = col, lwd = 2, frame.plot = FALSE, ...)

## S3 method for class 'data.frame': caterpillarPlot(x, env, useN2 = TRUE, xlab, ...)

## S3 method for class 'wa': caterpillarPlot(x, type = c("observed","model"), ...)

Arguments

x
For the default method, a numeric vector of species optima. For the data.frame method a species data matrix or data frame. For the wa method an object of class "wa".
tol
numeric; vector of species tolerances.
env
numeric; variable for which optima and tolerances are required.
useN2
logical; should Hill's N2 values be used to produce un-biased tolerances?
decreasing
logical; should the sort order of the species be increasing or decreasing?
mult
numeric; multiplication factor for species' tolerances.
labels
character; vector of labels for the species names with which to annotate the y-axis. If missing, names(x) is used.
xlab
character; the x-axis label. If NULL, the default, a description of env is used.
pch, bg, col
The plotting character to use and its background and foreground colour. See par.
lcol, lwd
The colour and line width to use for the tolerance range.
type
character; "observed" uses the actual tolerances observed from the data. "model" uses the tolerances used in the WA model where very small tolerances have been reset for some definition of small.
frame.plot
logical; should a box be drawn round the plot?
...
Additional graphical arguments to be passed on to plotting functions.

Value

  • The function results in a plot on the currently active device. A data frame with components Optima and Tolerance is returned invisibly.

Details

The function may also be called using the short form name caterpillar: caterpillar(x, ...)

See Also

For the underlying computations optima and tolerance.

Examples

Run this code
data(ImbrieKipp)
data(SumSST)

## default plot
caterpillarPlot(ImbrieKipp, SumSST)

## customisation
opttol <-
    caterpillarPlot(ImbrieKipp, SumSST, col = "red2",
                    bg = "yellow", lcol = "blue",
                    xlab = expression(Summer ~ Sea ~ Surface ~
                                      Temperature~(degree*C)))

## invisibly returns the optima and tolerances
head(opttol)

## The short form name may be easier on the typing fingers
caterpillar(ImbrieKipp, SumSST)

Run the code above in your browser using DataLab