sample and can be used to determine the expected value of a diversity index under a specified sampling intensity. A Monte-Carlo procedure is used to re-sample a given observation with replacement at each user-specified sampling intensity. The resampling can take place through one of two schemes. First, where the observed frequencies of species are assumed to represent the true underlying values, and second, where a user-specified vector of probabilities is used to control the resampling. The function calculates a diversity index over each simulated sample and summarises these for each specified level of sampling intensity via their mean.
H.sampler(x = "community matrix (spp=col,obs=row)", n = "sample size vector", nit = "number of iterations to use", base = exp(1), corr = FALSE, p = NULL, method = "Shannon")sample, Gd, Hs, countx=array(round(runif(100,1,10)),c(10,10))
H.sampler(x,n=1:10,nit=10,base=exp(1))
Run the code above in your browser using DataLab