Learn R Programming

velociraptr (version 1.0)

subsampleIndividuals: Iterative Rarefaction

Description

Calculate the richness of a sample after subsampling to a set number of individuals.

Usage

subsampleIndividuals(Abundance, Quota, Trials = 100)

Arguments

Abundance

A vector of taxon abundances

Quota

A whole number stating the desired sample size

Trials

Number of iterations

Value

A numeric value of estimated richness

Details

This is an empirical approach to subsampling a vector of taxonomic abundances to a set number of abundances. It uses a bootstrapping approach rather than the more common analytical solution provided in other packages.

Examples

Run this code
# NOT RUN {
# Download a test dataset of Miocene-Pleistocene bivalves
# DataPBDB<-downloadPBDB(Taxa="Bivalvia",StartInterval="Miocene",StopInterval="Pleistocene")

 # Clean up the taxonomy by removing subgenus designation
 # DataPBDB<-cleanTaxonomy(DataPBDB,"genus")

# Create a community matrix of genera by tectonic plate ids
# CommunityMatrix<-abundanceMatrix(DataPBDB,Rows="geoplate",Columns="genus")

# Cull out depauperate samples and rare taxa
# CommunityCull<-cullMatrix(CommunityMatrix,5,100)

# Calculate the standardized richness of each plate assuming a fixed sample size of 100 occurrences
# StandardizedRichness<-apply(CommunityCull,1,subsampleIndividuals,100)

# }

Run the code above in your browser using DataLab