Type: | Package |
Title: | Algorithms for Electivity Indices |
Version: | 1.0.2 |
Date: | 2019-08-13 |
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. |
URL: | https://github.com/DesiQuintans/electivity |
BugReports: | https://github.com/DesiQuintans/electivity/issues |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 3.4.0) |
Suggests: | utils (≥ 3.4.2), usethis (≥ 1.0.0) |
RoxygenNote: | 6.1.1 |
License: | MIT + file LICENSE |
NeedsCompilation: | no |
Packaged: | 2019-08-19 21:38:27 UTC; 90928711 |
Author: | Desi Quintans |
Maintainer: | Desi Quintans <science@desiquintans.com> |
Repository: | CRAN |
Date/Publication: | 2019-08-20 14:50:05 UTC |
Algorithms for electivity indices and measures of resource use versus availability.
Description
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.
Details
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).
Author
Desi Quintans (@eco_desi)
URL
https://github.com/DesiQuintans/electivity/
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
data(moth_distrib)
chesson_alpha(moth_distrib$r, moth_distrib$p)
vs_select_coef(moth_distrib$r, moth_distrib$p)
Ivlev's electivity, E
Description
Bounded between -1.0 (avoidance), 0 (random feeding), and +1.0 (preference).
Usage
ivlev_electivity(r, p)
Arguments
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
Value
A numeric vector.
Source
Lechowicz, M.J., 1982. The sampling characteristics of electivity indices. Oecologia 52, 22–30. https://doi.org/10.1007/BF00349007
Examples
data(moth_distrib)
ivlev_electivity(moth_distrib$r, moth_distrib$p)
Ivlev's forage ratio, E'
Description
Bounded between +0.1 (avoidance), +1.0 (random feeding), and infinity (preference).
Usage
ivlev_forage(r, p, log10 = FALSE)
Arguments
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
log10 |
(Logical) If |
Value
A numeric vector.
Examples
data(moth_distrib)
ivlev_forage(moth_distrib$r, moth_distrib$p, log10 = FALSE)
ivlev_forage(moth_distrib$r, moth_distrib$p, log10 = TRUE)
Jacob's modified electivity, D
Description
Bounded between +0.1 (avoidance), +1.0 (random feeding), and infinity (preference).
Usage
jacob_electivity(r, p)
Arguments
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
Value
A numeric vector.
Examples
data(moth_distrib)
jacob_electivity(moth_distrib$r, moth_distrib$p)
Jacob's modified forage ratio, Q
Description
When logged (which is Jacob's recommendation), bounded between negative and positive infinity.
Usage
jacob_forage(r, p, log10 = FALSE)
Arguments
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
log10 |
(Logical) If TRUE, return the value as Log10. |
Value
A numeric vector.
Examples
data(moth_distrib)
jacob_forage(moth_distrib$r, moth_distrib$p, log10 = TRUE)
jacob_forage(moth_distrib$r, moth_distrib$p, log10 = FALSE)
Distribution of gypsy moth larvae, Lymantria dispar, feeding in a deciduous forest in southwestern Quebec, Canada.
Description
This is Table 2 in the cited source paper.
Usage
moth_distrib
Format
A dataframe with 19 rows and 6 variables:
- binomen
Species of tree.
- n_indiv
Number of randomly sampled trees.
- dbh_cm_sum
Summed diameters at breast height, in centimeters.
- larva_mean_sum
Summed numbers of larvae (the means of two counts taken on June 26-27, 1979 and July 3-4, 1979).
- r
Relative proportion of larvae feeding on trees (Lechowicz 1982, Equation 2)
- p
Estimate of foliage biomass (Lechowicz 1982, Equation 1).
Source
Lechowicz, M.J., 1982. The sampling characteristics of electivity indices. Oecologia 52, 22–30. https://doi.org/10.1007/BF00349007
Examples
data(moth_distrib)
Electivities of gypsy moth larvae
Description
This is Table 3 in the cited source paper.
Usage
moth_elect
Format
A dataframe with 19 rows and 8 variables:
- binomen
Species of tree.
- E
Ivlev's electivity index.
- E_prime_i
Ivlev's forage ratio.
- D_i
Jacob's modified electivity.
- log_Q_i
Jacob's modified forage ratio, log10.
- L_i
Strauss' linear index.
- W_i
Chesson's alpha, or Vanderploeg and Scavia's selectivity coefficient.
- E_star_i
Vanderploeg and Scavia's relativised electivity.
Source
Lechowicz, M.J., 1982. The sampling characteristics of electivity indices. Oecologia 52, 22–30. https://doi.org/10.1007/BF00349007
Examples
data(moth_elect)
Strauss' linear index, L
Description
Bounded between -1.0 (avoidance), 0 (random feeding), and +1.0 (preference).
Usage
strauss_linear(r, p)
Arguments
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
Value
A numeric vector.
Examples
data(moth_distrib)
strauss_linear(moth_distrib$r, moth_distrib$p)
Vanderploeg and Scavia's relativised electivity, E*
Description
Bounded between -1.0 (avoidance), 0 (random feeding), and +1.0 (preference).
Usage
vs_electivity(r, p, na.rm = TRUE)
Arguments
r |
(Numeric) Resource utilisation. |
p |
(Numeric) Resource availability. |
na.rm |
(Logical) If |
Value
A numeric vector.
Examples
data(moth_distrib)
vs_electivity(moth_distrib$r, moth_distrib$p)