Learn R Programming

goeveg (version 0.3.0)

specresponses: Multiple species response curves

Description

This function fits multiple species response curves to visualize species responses to environmental gradients or ordination axes. It is based on Logistic Regression using Generalised Linear Models (GLMs) or Generalized Additive Models (GAMs) with integrated smoothness estimation. In contrast to specresponse this function can draw multiple curves into one plot.

Usage

specresponses(matrix, var, main, xlab, model = "unimodal", method = "env", axis = 1, points = FALSE, bw = FALSE)

Arguments

matrix
Community data, a matrix-like object with samples in rows and species in columns. Response curves are drawn for all (selected) columns (species).
var
Vector containing environmental variable (per plot) OR vegan ordination result object if method = "ord".
main
Optional: Main title.
xlab
Optional: Label of x-axis.
model
Defining the assumed species responses: Default method = "unimodal" fits unimodal responses. Other methods are method = "linear" (linear responses), method = "bimodal" (bimodal responses), method = "auto" (automatic selection based on AIC) and method = "gam" (using GAM with smoother).
method
Method defining the type of variable. Default method = "env" fits a response curve to environmental variables. Alternatively method = "ord" fits a response along ordination axes.
axis
Ordination axis (only if method = "ord").
points
If set on TRUE the species occurences are shown as points. To avoid overlapping they are shown with vertical offset.
bw
If set on TRUE the lines will be drawn in black/white with different line types instead of colours.

Details

For response curves based on environmental gradients the argument var takes a single vector containing the variable corresponding to the species abundances. For a response to ordination axis (method = "ord") the argument var requires a vegan ordination result object (e.g. from decorana, cca, rda or metaMDS). First axis is used as default. If you plot a response curve for only one species the use of specresponse is recommended.

See Also

specresponse

Examples

Run this code
## Species (columns) need to be selected; call names() to get column numbers
names(schedenveg)
## Draw multiple species response curves on variable in black/white
specresponses(schedenveg[ ,c(9,18,14,19)], schedenenv$height_herb, bw = TRUE)

## Draw the same curves based on GAM
specresponses(schedenveg[ ,c(9,18,14,19)], schedenenv$height_herb, bw = TRUE, model = "gam")

## Draw multiple species response curves on variable with
## custom x-axis label and points of occurences
specresponses(schedenveg[ ,c(9,18,14,19)], schedenenv$height_herb,
    xlab = "Height of herb layer (cm)", points = TRUE)

## Draw multiple species response curves on ordination axes
## First calculate DCA
library(vegan)
scheden.dca <- decorana(schedenveg)
specresponses(schedenveg[ ,c(9,18,14,19)], scheden.dca, method = "ord")
specresponses(schedenveg[ ,c(9,18,14,19)], scheden.dca, method = "ord", axis = 2)


Run the code above in your browser using DataLab