get_samples: Generate distribution of sampled community matrices from an...

View source: R/mobr_boxplots.R

get_samplesR Documentation

Generate distribution of sampled community matrices from an original matrix.

Description

The sampled matrices are either bootstrap or leave-one-out (the default) samples. The bootstrap samples represent a random set of the rows sampled with replacement from the original matrix. The leave-one-out samples are generated by removing each sample one at a time from the original community matrix.

Usage

get_samples(abund_mat, algo = "loo", n_boot = 1000)

Arguments

abund_mat

Abundance based site-by-species table. Species as columns

algo

can be either 'boot' or 'loo' for bootstrap or leave-one-out methods respectively. Default value is 'loo'.

n_boot

how to many boot strapped samples to create, defaults to 1000.

Details

These sampled community matrices can become the input to calc_comm_div_ci for computing confidence intervals of diversity metrics.

Note, it is unclear which sampling algorithm (bootstrap or loo) is least biased and most efficient for the purpose of generating confidence intervals.

Value

a list of community matrices which are sampled from the original input matrix.

Author(s)

Felix May and Dan McGlinn

References

Chao, A. 1984. Nonparametric Estimation of the Number of Classes in a Population. Scandinavian Journal of Statistics 11:265–270.

Chao, A. 1987. Estimating the population size for capture-recapture data with unequal catchability. Biometrics, 43, 783-791.

Gotelli, N. J., and R. K. Colwell. 2001. Quantifying biodiversity: procedures and pitfalls in the measurement and comparison of species richness. Ecology Letters 4:379–391.

Hurlbert, S. H. 1971. The nonconcept of species diversity: a critique and alternative parameters. Ecology 52:577–586.

Jost, L. 2007. Partitioning diversity into independent alpha and beta components. Ecology 88:2427–2439.

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.

Whittaker, R. H. 1972. Evolution and measurement of species diversity. Taxon 21:213–251.

See Also

calc_comm_div_ci

Examples

data(tank_comm)
# 2 leave-one-out samples
lapply(get_samples(tank_comm)[1:2], head)
# 2 bootstrap samples
lapply(get_samples(tank_comm, algo = 'boot', n_boot = 2), head)


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