Title: | Algorithms for Electivity Indices |
---|---|
Description: | Provides all electivity algorithms (including Vanderploeg and Scavia electivity) that were examined in Lechowicz (1982) <doi:10.1007/BF00349007>, plus the example data that were provided for moth resource utilisation. |
Authors: | Desi Quintans [aut, cre] |
Maintainer: | Desi Quintans <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.2 |
Built: | 2025-02-06 05:11:23 UTC |
Source: | https://github.com/desiquintans/electivity |
These two functions calculate the same value; alpha and W are identical.
chesson_alpha(r, p, na.rm = TRUE) vs_select_coef(r, p, na.rm = TRUE)
chesson_alpha(r, p, na.rm = TRUE) vs_select_coef(r, p, na.rm = TRUE)
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
na.rm |
(Logical) If 'TRUE', 'NA's will be ignored when calculating the selectivity coefficient (W). |
A numeric vector.
data(moth_distrib) chesson_alpha(moth_distrib$r, moth_distrib$p) vs_select_coef(moth_distrib$r, moth_distrib$p)
data(moth_distrib) chesson_alpha(moth_distrib$r, moth_distrib$p) vs_select_coef(moth_distrib$r, moth_distrib$p)
This package is essentially Lechowicz (1982) turned into an R package. It includes all algorithms that were described therein plus the example data that was provided for moth resource utilisation.
Lechowicz, M.J., 1982. The sampling characteristics of electivity indices. Oecologia 52, 22–30. https://doi.org/10.1007/BF00349007
Users are encouraged to read the original paper before deciding which algorithm
is most useful for them. Lechowicz recommended Vanderploeg and Scavia's E* index
(implemented in this package as vs_electivity()
) as "the single best, but not
perfect, electivity index" because "E* embodies a measure of the feeder's
perception of a food's value as a function of both its abundance and the
abundance of other food types present." In practice, he found that all indices
returned nearly identical rank orders of preferred hosts except for Strauss'
linear index (L).
Desi Quintans (@eco_desi)
https://github.com/DesiQuintans/electivity/
Bounded between -1.0 (avoidance), 0 (random feeding), and +1.0 (preference).
ivlev_electivity(r, p)
ivlev_electivity(r, p)
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
A numeric vector.
Lechowicz, M.J., 1982. The sampling characteristics of electivity indices. Oecologia 52, 22–30. https://doi.org/10.1007/BF00349007
data(moth_distrib) ivlev_electivity(moth_distrib$r, moth_distrib$p)
data(moth_distrib) ivlev_electivity(moth_distrib$r, moth_distrib$p)
Bounded between +0.1 (avoidance), +1.0 (random feeding), and infinity (preference).
ivlev_forage(r, p, log10 = FALSE)
ivlev_forage(r, p, log10 = FALSE)
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
log10 |
(Logical) If |
A numeric vector.
data(moth_distrib) ivlev_forage(moth_distrib$r, moth_distrib$p, log10 = FALSE) ivlev_forage(moth_distrib$r, moth_distrib$p, log10 = TRUE)
data(moth_distrib) ivlev_forage(moth_distrib$r, moth_distrib$p, log10 = FALSE) ivlev_forage(moth_distrib$r, moth_distrib$p, log10 = TRUE)
Bounded between +0.1 (avoidance), +1.0 (random feeding), and infinity (preference).
jacob_electivity(r, p)
jacob_electivity(r, p)
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
A numeric vector.
data(moth_distrib) jacob_electivity(moth_distrib$r, moth_distrib$p)
data(moth_distrib) jacob_electivity(moth_distrib$r, moth_distrib$p)
When logged (which is Jacob's recommendation), bounded between negative and positive infinity.
jacob_forage(r, p, log10 = FALSE)
jacob_forage(r, p, log10 = FALSE)
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
log10 |
(Logical) If TRUE, return the value as Log10. |
A numeric vector.
data(moth_distrib) jacob_forage(moth_distrib$r, moth_distrib$p, log10 = TRUE) jacob_forage(moth_distrib$r, moth_distrib$p, log10 = FALSE)
data(moth_distrib) jacob_forage(moth_distrib$r, moth_distrib$p, log10 = TRUE) jacob_forage(moth_distrib$r, moth_distrib$p, log10 = FALSE)
This is Table 2 in the cited source paper.
moth_distrib
moth_distrib
A dataframe with 19 rows and 6 variables:
Species of tree.
Number of randomly sampled trees.
Summed diameters at breast height, in centimeters.
Summed numbers of larvae (the means of two counts taken on June 26-27, 1979 and July 3-4, 1979).
Relative proportion of larvae feeding on trees (Lechowicz 1982, Equation 2)
Estimate of foliage biomass (Lechowicz 1982, Equation 1).
Lechowicz, M.J., 1982. The sampling characteristics of electivity indices. Oecologia 52, 22–30. https://doi.org/10.1007/BF00349007
data(moth_distrib)
data(moth_distrib)
This is Table 3 in the cited source paper.
moth_elect
moth_elect
A dataframe with 19 rows and 8 variables:
Species of tree.
Ivlev's electivity index.
Ivlev's forage ratio.
Jacob's modified electivity.
Jacob's modified forage ratio, log10.
Strauss' linear index.
Chesson's alpha, or Vanderploeg and Scavia's selectivity coefficient.
Vanderploeg and Scavia's relativised electivity.
Lechowicz, M.J., 1982. The sampling characteristics of electivity indices. Oecologia 52, 22–30. https://doi.org/10.1007/BF00349007
data(moth_elect)
data(moth_elect)
Bounded between -1.0 (avoidance), 0 (random feeding), and +1.0 (preference).
strauss_linear(r, p)
strauss_linear(r, p)
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
A numeric vector.
data(moth_distrib) strauss_linear(moth_distrib$r, moth_distrib$p)
data(moth_distrib) strauss_linear(moth_distrib$r, moth_distrib$p)
Bounded between -1.0 (avoidance), 0 (random feeding), and +1.0 (preference).
vs_electivity(r, p, na.rm = TRUE)
vs_electivity(r, p, na.rm = TRUE)
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
na.rm |
(Logical) If |
A numeric vector.
data(moth_distrib) vs_electivity(moth_distrib$r, moth_distrib$p)
data(moth_distrib) vs_electivity(moth_distrib$r, moth_distrib$p)