divsamplenum: DivSampleNum

DivSampleNumR Documentation

DivSampleNum

Description

Function to generate an integer sequence representing the lengths of nested samples of sample

Usage

DivSampleNum(ms, n)

Arguments

ms

the main sample, either as a 2-column data.frame (species ID, count of species), or a vector of species IDs.

n

desired number of nested samples (integer)

Details

This function produces the default list of nested sample lengths for the DivE algorithm. For the vector representation of the main sample (ms) it is equivalent to sort(round(seq(from=length(ms)/n, to=length(ms), by=length(ms)/n)), decreasing=TRUE).

Value

A decreasing sequence of nested sample lengths.

Author(s)

Daniel J. Laydon, Aaron Sim, Charles R.M. Bangham, Becca Asquith

References

Laydon, D. J., Melamed, A., Sim, A., Gillet, N. A., Sim, K., Darko, S., Kroll, S., Douek, D. C., Price, D., Bangham, C. R. M., Asquith, B., Quantification of HTLV-1 clonality and TCR diversity, PLOS Comput. Biol. 2014

Examples

require(DivE)
data(Bact1)

DivSampleNum(Bact1, 3)
DivSampleNum(Bact1, 6)


DivE documentation built on Oct. 14, 2023, 5:08 p.m.