Learn R Programming

pastecs (version 1.0-2)

abund: Sort variables by abundance

Description

Sort variables (usually species in a species x stations matrix) in function of their abundance, either in number of non-null values, or in number of individuals (in log). The f coefficient allows adjusting weight given to each of these two criteria.

Usage

abund(x, f=0.2)
## S3 method for class 'abund':
summary(abd)
## S3 method for class 'abund':
plot(abd, n=abd$n, lvert=TRUE, lvars=TRUE, lcol=2, llty=2,
        all=TRUE, dlab=c("cumsum", "\% log(ind.)", "% non-zero"),
        dcol=c(1, 2, 4), dlty, dpos=c(1.5, 20), ...)
## S3 method for class 'abund':
lines(abd, n=abd$n, lvert=TRUE, lvars=TRUE, \dots)
## S3 method for class 'abund':
identify(abd, label.pts=FALSE, lvert=TRUE, lvars=TRUE, \dots)
## S3 method for class 'abund':
extract(abd, n=abd$n, left=TRUE)

Arguments

x
A data frame containing the variables to sort according to their abundance in columns
f
Weight given to the number of individuals criterium (strictly included between 0 and 1; weight for the non-null values is 1-f. The default value, f=0.2, gives enough weight to the number of non-null values to get abundant species
abd
An 'abund' object returned by abund
n
The number of variables selected at left
lvert
If TRUE then a vertical line separate the n variables at left from the others
lvars
If TRUE then the x-axis labels of the n left variables are printed in a different color to emphasize them
lcol
The color to use to draw the vertical line (lvert=TRUE) and the variables labels (lvars=TRUE) at left af the nth variable. By default, color 2 is used
llty
The style used to draw the vertical line (lvert=TRUE). By default, a dashed line is used
all
If TRUE then all lines are drawn (cumsum, %log(ind.) and %non-null). If FALSE, only the cumsum line is drawn
dlab
The legend labels
dcol
Colors to use for drawing the various curves on the graph
dlty
The line style to use for drawing the various curves on the graph
dpos
The position of the legend box on the graph (coordinates of its top-left corner). A legend box is drawn only if all=TRUE
...
additional graph parameters
label.pts
Do we have to label points on the graph or to chose an extraction level with the identify() method?
left
If TRUE, the n variables at left are extracted. Otherwise, the total-n variables at right are extracted

Value

  • An object of type 'abund' is returned. It has methods print(), summary(), plot(), lines(), identify(), extract().

synopsis

abund(x, f=0.2) extract.abund(e, n, left=TRUE, ...) identify.abund(x, label.pts=FALSE, lvert=TRUE, lvars=TRUE, col=2, lty=2, ...) lines.abund(x, n=x$n, lvert=TRUE, lvars=TRUE, col=2, lty=2, ...) plot.abund(x, n=x$n, lvert=TRUE, lvars=TRUE, lcol=2, llty=2, all=TRUE, dlab=c("cumsum", "% log(ind.)", "% non-zero"), dcol=c(1,2,4), dlty=c(par("lty"), par("lty"), par("lty")), dpos=c(1.5, 20), type="l", xlab="variables", ylab="abundance", main=paste("Abundance sorting for:",x$data, "with f =", round(x$f, 4)), ...) print.abund(x, ...) print.summary.abund(x, ...) summary.abund(object, ...)

Details

Successive sorts can be applied. For instance, a first sort with f = 0.2, followed by an extraction of rare species and another sort with f = 1 allows to collect only rare but locally abundant species.

References

Ibanez, F., J.-C. Dauvin & M. Etienne, 1993. Comparaison des �volutions � long terme (1977-1990) de deux peuplements macrobenthiques de la baie de Morlaix (Manche occidentale): relations avec les facteurs hydroclimatiques. J. Exp. Mar. Biol. Ecol., 169:181-214.

See Also

escouf

Examples

Run this code
data(bnr)
bnr.abd <- abund(bnr)
summary(bnr.abd)
plot(bnr.abd, dpos=c(105, 100))
bnr.abd$n <- 26
# To identify a point on the graph, use: bnr.abd$n <- identify(bnr.abd)
lines(bnr.abd)
bnr2 <- extract(bnr.abd)
names(bnr2)

Run the code above in your browser using DataLab