Learn R Programming

DivE (version 1.1)

DivSampleNum: 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)

Value

A decreasing sequence of nested sample lengths.

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).

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

Run this code
# NOT RUN {
require(DivE)
data(Bact1)

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

# }

Run the code above in your browser using DataLab