calc_biodiv: Calculate biodiversity statistics from sites by species...

View source: R/mobr_boxplots.R

calc_biodivR Documentation

Calculate biodiversity statistics from sites by species table.

Description

Calculate biodiversity statistics from sites by species table.

Usage

calc_biodiv(
  abund_mat,
  groups,
  index,
  effort,
  extrapolate,
  return_NA,
  rare_thres
)

Arguments

abund_mat

Sites by species table with species abundances in the respective cells

groups

Vector with group labels for the sites. The length of the vector has to correspond to the number of rows of the sites by species table.

index

The calculated biodiversity indices. The options are

  • N ... Number of individuals (total abundance)

  • S ... Number of species

  • S_n ... Rarefied or extrapolated number of species for n individuals

  • S_asymp ... Estimated asymptotic species richness

  • f_0 ... Estimated number of undetected species

  • pct_rare ... The percent of species with abundances below rare_thres

  • PIE ... Hurlbert's PIE (Probability of Interspecific Encounter)

  • S_PIE ... Effective number of species based on PIE

See the documentation of get_mob_stats for further details on the biodiversity indices.

effort

The standardized number of individuals used for the calculation of rarefied species richness. This can a be single value or an integer vector.

extrapolate

Boolean which specifies if richness should be extrapolated when effort is larger than the number of individuals using the chao1 method.

return_NA

Boolean in which the rarefaction function returns the observed S when effort is larger than the number of individuals. If set to TRUE then NA is returned. Note that this argument is only relevant when extrapolate = FALSE.

rare_thres

The threshold that determines how pct_rare is computed. It can range from (0, 1] and defaults to 0.05 which specifies that any species with less than or equal to 5 considered rare. It can also be specified as "N/S" which results in using average abundance as the threshold which McGill (2011) found to have the best small sample behavior.

Details

This function is primarily intended as auxiliary function used in get_mob_stats, but can be also used directly for data exploration.

Value

A data.frame with four columns:

  • group ... Group label for sites

  • index ... Name of the biodiversity index

  • effort ... Sampling effort for rarefied richness (NA for the other indices)

  • value ... Value of the biodiversity index

Author(s)

Felix May and Dan McGlinn

References

McGill, B. J. 2011. Species abundance distributions. Pages 105-122 Biological Diversity: Frontiers in Measurement and Assessment, eds. A.E. Magurran and B.J. McGill.


MoBiodiv/mobr documentation built on Jan. 31, 2024, 6:15 p.m.