rarify: Subsample samples of organisms to a fixed count

View source: R/RIVPACS.R

rarifyR Documentation

Subsample samples of organisms to a fixed count

Description

Subsample samples of organizms to a fixed count.

Usage

rarify(sample, taxon, count, n)

Arguments

sample

a vector of sample identifiers

taxon

a vector of taxon identifiers

count

a vector of counts for each taxa in each sample

n

the size of the subsample to select

Examples

d <- expand.grid(sample = 1:2, 
                taxon = c('Ephemeroptera', 'Plecoptera', 'Trichoptera'))
d$count <- runif(6, 10, 20)
rarify(d$sample, d$taxon, d$count, 30)

jasonelaw/RIVPACS documentation built on Sept. 27, 2022, 6:34 p.m.