coverage: Sample Coverage of a Community

View source: R/coverage.R

coverageR Documentation

Sample Coverage of a Community

Description

coverage() calculates an estimator of the sample coverage of a community described by its abundance vector. coverage_to_size() estimates the sample size corresponding to the chosen sample coverage.

Usage

coverage(x, ...)

## S3 method for class 'numeric'
coverage(
  x,
  estimator = c("ZhangHuang", "Chao", "Turing", "Good"),
  level = NULL,
  as_numeric = FALSE,
  ...,
  check_arguments = TRUE
)

## S3 method for class 'abundances'
coverage(
  x,
  estimator = c("ZhangHuang", "Chao", "Turing", "Good"),
  level = NULL,
  ...,
  check_arguments = TRUE
)

coverage_to_size(x, ...)

## S3 method for class 'numeric'
coverage_to_size(
  x,
  sample_coverage,
  estimator = c("ZhangHuang", "Chao", "Turing", "Good"),
  as_numeric = FALSE,
  ...,
  check_arguments = TRUE
)

## S3 method for class 'abundances'
coverage_to_size(
  x,
  sample_coverage,
  estimator = c("ZhangHuang", "Chao", "Turing", "Good"),
  ...,
  check_arguments = TRUE
)

Arguments

x

An object.

...

Unused.

estimator

An estimator of the sample coverage. "ZhangHuang" is the most accurate but does not allow choosing a level. "Good"'s estimator only allows interpolation, i.e. estimation of the coverage of a subsample. "Chao" allows estimation at any level, including extrapolation. "Turing" is the simplest estimator, equal to 1 minus the number of singletons divided by the sample size.

level

The level of interpolation or extrapolation, i.e. an abundance.

as_numeric

if TRUE, a number or a numeric vector is returned rather than a tibble.

check_arguments

if TRUE, the function arguments are verified. Should be set to FALSE to save time when the arguments have been checked elsewhere.

sample_coverage

The target sample coverage.

Details

The sample coverage C of a community is the total probability of occurrence of the species observed in the sample. 1-C is the probability for an individual of the whole community to belong to a species that has not been sampled.

The historical estimator is due to Turing \insertCiteGood1953divent. It only relies on singletons (species observed only once). Chao's \insertCiteChao2010adivent estimator uses doubletons too and Zhang-Huang's \insertCiteChao1988,Zhang2007divent uses the whole distribution.

If level is not NULL, the sample coverage is interpolated or extrapolated. Interpolation by the Good estimator relies on the equality between sampling deficit and the generalized Simpson entropy \insertCiteGood1953divent. The \insertCiteChao2014;textualdivent estimator allows extrapolation, reliable up a level equal to the double size of the sample.

Value

coverage() returns a named number equal to the calculated sample coverage. The name is that of the estimator used.

coverage_to_size() returns a number equal to the sample size corresponding to the chosen sample coverage.

References

\insertAllCited

Examples

coverage(paracou_6_abd)
coverage_to_size(paracou_6_abd, sample_coverage = 0.9)


divent documentation built on April 3, 2025, 7:40 p.m.