Description Usage Arguments Details Author(s) Examples

This function fits 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. The function can draw response curves for single or multiple species.

1 2 |

`species` |
Species data (either a community matrix object with samples in rows and species in columns - response curves are drawn for all (selected) columns; or a single vector containing species abundances per plot). |

`var` |
Vector containing environmental variable (per plot) |

`main` |
Optional: Main title. |

`xlab` |
Optional: Label of x-axis. |

`model` |
Defining the assumed species response: Default |

`method` |
Method defining the type of variable. Default |

`axis` |
Ordination axis (only if |

`points` |
If set on |

`bw` |
If set on |

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.

By default the response curves are drawn with automatic GLM model selection based on AIC out of GLMs with 1 - 3 polynomial degrees (thus excluding bimodal responses which must be manually defined). The GAM model is more flexible and choses automatically between an upper limit of 3 - 6 degrees of freedom for the regression smoother.

Available information about species is reduced to presence-absence as species abundances can contain much noise (beeing affected by complex factors) and the results of Logistic Regression are easier to interpret showing the "probabilities of occurence". Be aware that response curves are only a simplification of reality (model) and their shape is strongly dependent on the available dataset.

Friedemann Goral (fgoral@gwdg.de)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ```
## Draw species response curve for one species on environmental variable
## with points of occurences
specresponse(schedenveg$ArrElat, schedenenv$soil_depth, points = TRUE)
## Draw species response curve on environmental variable with custom labels
specresponse(schedenveg$ArrElat, schedenenv$soil_depth, points = TRUE,
main = "Arrhenatherum elatius", xlab = "Soil depth")
## Draw species response curve on ordination axes
## First calculate DCA
library(vegan)
scheden.dca <- decorana(schedenveg)
# Using a linear model on first axis
specresponse(schedenveg$ArrElat, scheden.dca, method = "ord", model = "linear")
# Using an unimodal model on second axis
specresponse(schedenveg$ArrElat, scheden.dca, method = "ord", axis = 2, model = "unimodal")
## Community data: species (columns) need to be selected; call names() to get column numbers
names(schedenveg)
## Draw multiple species response curves on variable in black/white
specresponse(schedenveg[ ,c(9,18,14,19)], schedenenv$height_herb, bw = TRUE)
## Draw the same curves based on GAM
specresponse(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
specresponse(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
specresponse(schedenveg[ ,c(9,18,14,19)], scheden.dca, method = "ord")
specresponse(schedenveg[ ,c(9,18,14,19)], scheden.dca, method = "ord", axis = 2)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.