calc_div: Compute various diversity indices from a vector of species...

View source: R/mobr_boxplots.R

calc_divR Documentation

Compute various diversity indices from a vector of species abundances (i.e., one row of a community matrix)

Description

Compute various diversity indices from a vector of species abundances (i.e., one row of a community matrix)

Usage

calc_div(
  x,
  index,
  effort = NA,
  rare_thres = 0.05,
  PIE_replace = FALSE,
  C_target = NULL,
  extrapolate = TRUE,
  ...
)

Arguments

x

is a vector of species abundances

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_C ... Estimate species richness of a given level of coverage by C_target_gamma

  • S_asymp ... Estimated asymptotic species richness

  • f_0 ... Estimated number of undetected species

  • pct_rare ... The percent of rare species as defined by rare_thres

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

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

See Details for additional information on the biodiversity statistics.

effort

The standardized number of individuals used for the calculation of rarefied species richness. This must be a single integer.

rare_thres

The threshold that determines how the metric 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 abundance in a sample is 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.

PIE_replace

Used for PIE and SPIE. If TRUE, sampling with replacement is used. Otherwise, sampling without replacement (default).

C_target

When computing coverage based richness (S_C) then this argument can be used to specify the coverage to be used for the richness estimate. This defaults to NA in which case the target cover is computed by calc_C_target (i.e., the largest allowable sample size).

extrapolate

Boolean which specifies if richness should be extrapolated when effort is larger than the number of individuals using the chao1 method (Chao 1984, 1987). Defaults to TRUE.

...

additional arguments that can be passed to the function rarefaction when computing S_n.

Examples

 
data(inv_tank)
calc_div(tank_comm[1, ], 'S_n', effort = c(5, 10))
calc_div(tank_comm[1, ], 'S_C', C_target = 0.9)

MoBiodiv/mobr documentation built on Oct. 26, 2024, 10:51 a.m.