Learn R Programming

electivity (version 1.0.2)

chesson_alpha: Chesson's alpha, or Vanderploeg and Scavia's selectivity coefficient (W)

Description

These two functions calculate the same value; alpha and W are identical.

Usage

chesson_alpha(r, p, na.rm = TRUE)

vs_select_coef(r, p, na.rm = TRUE)

Arguments

r

(Numeric) Resource utilisation.

p

(Numeric) Resource availability.

na.rm

(Logical) If `TRUE`, `NA`s will be ignored when calculating the selectivity coefficient (W).

Value

A numeric vector.

Examples

Run this code
# NOT RUN {
data(moth_distrib)

chesson_alpha(moth_distrib$r, moth_distrib$p)
vs_select_coef(moth_distrib$r, moth_distrib$p)
# }

Run the code above in your browser using DataLab