rarefy: Calculate rarefaction using boostrapping

View source: R/abundance.R

rarefyR Documentation

Calculate rarefaction using boostrapping

Description

Calculate rarefaction using boostrapping

Usage

rarefy(
  counts,
  samples = unique(round(sum(counts) * seq(0.1, 1, 0.1))),
  reps = 1000,
  chaoAdjust = FALSE,
  replace = FALSE,
  minObs = 1,
  statFunc = stats::quantile,
  ...
)

Arguments

counts

Counts of species

samples

Vector of numbers of draws to calculate rarefaction at

reps

How many random samples to take at each step

chaoAdjust

If TRUE calculate chao-predicted species number on each random draw

replace

If TRUE sample with replacements. If FALSE sample without replacement.

minObs

Minimum number of counts to be counted as present e.g. minobs=2 discards singletons (ignored if chaoAdjust=TRUE)

statFunc

Function to apply to counts e.g. mean or median

...

Additional arguments to statFunc

Value

Dataframe of calculated quantiles with rownames of the number of samples drawn

See Also

rareEquation, chao, link{rarefyCounts}

Examples

rarefy(1:20,reps=100)
rarefy(1:20,reps=100,chaoAdjust=TRUE)

sherrillmix/dnar documentation built on July 18, 2022, 10:07 p.m.