Computes rarefaction curves and statistical envelop

Share:

Description

rarc computes rarefaction curves and returns a data frame with bootstrap estimates of species richness, its statistical envelop and the average number of individuals for a given sample size.

Usage

1
rarc(matrix, samplesize=NULL, nrandom=99, p1=0.975, p2=0.025, save=FALSE)

Arguments

matrix

matrix is a typical species-sample matrix. Rows correspond to samples whereas columns stand for species.

samplesize

A vector containing the different sample sizes for which the computations are required. If missing or non vector, samplesize is replaced by a sequence from 1 to the maximum possible sample size given the size of matrix.

nrandom

nrandom is the number of a randomizations used in the bootstrap estimation. Values of nrandom <10 or NULL are set to 99.

p1

The probability value used to compute the upper bound of the statistical envelop using quantile. Default set to 0.975.

p2

The probability value used to compute the lower bound of the statistical envelop using quantile. Default set to 0.025.

save

If TRUE the function returns the raw values used in the estimation of the quantiles.

Value

out

A data frame with 5 columns giving the mean species richness, the lower and upper bound of the richness corresponding to the quantile values for p1 and p2, the mean number of individuals and the sample size.

bootstrapped.val

Generated if save=TRUE. A list of length of the number of different sample sizes analyzed containing the raw values used to computed the quantiles. These values can be used for example to compute the standard error as illustrated in the examples below.

Author(s)

Jean-Pierre Rossi jean-pierre.rossi@supagro.inra.fr

See Also

raref, raref2, rich

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
data(ef)
t <- rarc(ef,samplesize=c(5,10,15,20,25), nrandom=30, p1=0.975, p2=0.025)
head(t)

# Plot the outputs
plot(t$out[,6],t$out[,1], type="b", ylim=range(c(t$out[,2],t$out[,3])),
	xlab="number of sampling units", ylab="richness")
points(t$out[,6] , t$out[,2], type="l", col="red")
points(t$out[,6] , t$out[,3], type="l", col="blue")

## End(Not run)

#See the package vignette for more examples. Type: vignette("rich_introduction").