rarc: Computes rarefaction curves and statistical envelop

Description Usage Arguments Value Author(s) See Also Examples

View source: R/rarc.R

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").

Example output

rich version 1.0.1 is loaded
You can access the package vignette by typing vignette('rich_introduction') in the R console
$out
  mean.richness lb.richness ub.richness mean.nb.individuals  samples sample
1      33.03333      22.450      49.550            418.5667 194.5808      5
2      54.56667      38.725      70.825            882.8000 295.5350     10
3      69.43333      55.525      81.275           1171.5333 297.5432     15
4      77.33333      59.075      90.275           1679.9667 397.8832     20
5      84.70000      66.625      96.200           1952.2333 470.8580     25

rich documentation built on May 2, 2019, 6:42 a.m.