| preseqR.nonreplace.sampling {preseqR} | R Documentation |
Generating a histogram by subsampling without replacement.
preseqR.nonreplace.sampling(size, n)
size |
An positive integer representing the size of the subsample. |
n |
A two-column matrix. The first column is the frequency j = 1,2,…; and the second column is n_j, the number of species with each species represented j times in the initial sample. The first column must be sorted in an ascending order. |
The function sample() in R is used to implement the function. We wrap the sample() function in a way that both input and output are histograms.
A two-column matrix as a subsample. The first column is the frequency j = 1,2,…; and the second column is n_j, the number of species with each species represented j times in the subsample.
Chao Deng
https://stat.ethz.ch/R-manual/R-patched/library/base/html/sample.html
## load library library(preseqR) ## import data data(FisherButterflyHist) ## generate a subsample of size 1000. preseqR.nonreplace.sampling(size=1000, FisherButterflyHist)