H.sampler {DiversitySampler}R Documentation

Shannon's Diversity Re-sampler

Description

A Monte-Carlo procedure is used to re-sample a given observation at each level of sampling. The expectation being that the mean of the re-sampling will approach Shannon's diversity index at that sample level.

Usage

H.sampler(x = "community matrix (spp=col,obs=row)", n = "sample size vector", nit = "number of iterations to use", base = exp(1))

Arguments

x A community matrix with observations in rows and species in columns.
n A vector or scalar of sample size(s).
nit Number of iterations of the Monte-Carlo procedure.
base The base of the logarithm used to calculate Shannon's index (DEFAULT = e).

Details

The Monte-Carlo procedure draws random individuals based on the relative abundances of the species in a given observation. This process is repeated for the number of specified iterations at each designated sample level. For each iteration, Shannon's diversity index is calculated, and the mean is taken from all the indices produced in each iteration.

Value

A matrix of Shannon's indices for each observation (rows) at each sampling level (columns).

Author(s)

Matthew K. Lau

Examples

x=array(round(runif(100,1,10)),c(10,10))
H.sampler(x,n=1:10,nit=10,base=exp(1))

[Package DiversitySampler version 1.0 Index]