rarefaction: Rarefaction

View source: R/rarefaction.r

rarefactionR Documentation

Rarefaction

Description

Performs rarefaction on count table.

Usage

rarefaction(x, sample)

## Default S3 method:
rarefaction(x, sample)

## S3 method for class 'Dataset'
rarefaction(x, sample)

Arguments

x

Either a matrix object or a Dataset object. If a matrix is passed, samples must be the columns and rows the species.

sample

Sample size, either a single integer value or a vector of the same length the number of columns (samples) of x.

Details

Modified from the rrarefy function of vegan-2.0-4.

Value

The defualt method returns a matrix with the rarefied counts. The Dataset method returns a Dataset object where the Tab element is the rarefied counts.

Author(s)

Sur Herrera Paredes

Examples

data(Rhizo)
data(Rhizo.map)
Dat <- create_dataset(Rhizo,Rhizo.map)
set.seed(712) # Always specify and save the seed before rarefaction
rarefaction(x=Dat$Tab,sample=100)
set.seed(712)
rarefaction(x=Dat,sample=100)$Tab

surh/AMOR documentation built on Feb. 21, 2023, 6:31 a.m.