get_sens: Sensitivity of taxa to an environmental gradient.

Description Usage Arguments Details Value Examples

Description

get_sens returns the sensitivity of each taxon in a community data frame (sp) to an environmental gradient (env_grad).

Usage

1
get_sens(sp, env_grad, mid = 5)

Arguments

sp

community data frame (sites as rows, taxa as columns, observations as values).

env_grad

numeric vector of environmental gradient scores, one for each site.

mid

numeric scalar taken as the gradient's midpoint for sensitivity (default is 5).

Details

Sensitivity is defined here by first finding how many detections were made above and below the midpoint (mid) of the gradient, taking their difference, and finally dividing this by the number of detections. Taxa with more detections below (mid) than above will have a negative sensitivity and vice versa. Note that while function est_brc requires that a reference gradient scaled to 0-10, get_sens does not require this.

Value

A data frame containing each taxon's sensitivity (Sens) to the gradient, and the number of sites the they were detected at (n).

Examples

1
2
3
4
x <- function() sample(0:1, 10, replace = TRUE)
sp <- data.frame(sp1 = x(), sp2 = x(), sp3 = x())
grad <- runif(10, 0, 10)
get_sens(sp, grad)

ngwalton/iec documentation built on May 23, 2019, 4:43 p.m.