sample.ref {BarcodingR} | R Documentation |
Sample Random Datasets from References (DNAbin)
Description
Randomly sample reference data at different levels of taxon.
Usage
sample.ref(ref, sample.porp = 0.5, sample.level = "full")
Arguments
ref |
Object of class "DNAbin" used as a reference dataset, which contains taxon information. |
sample.porp |
a numeric value between 0 and 1, indicating proportion of samples to draw at each level of taxon. |
sample.level |
a character string choosing from c("full","family","genus","species"). |
Value
a list containing the selected samples and the samples left, in DNAbin format stored in a matrix or a list.
Note
the ref must contain information on taxonomy, in format like, ">LS0909030M,Noctuidae_Himalaea_unica", i.e., "seqID,family_genus_species", or ">LS0909030M,Himalaea_unica"; in case there is only one sample/individual for a taxon level, this sample will be retained in ref.selected.
Author(s)
Ai-bing ZHANG, PhD. CNU, Beijing, CHINA.
References
zhangab2008(at)mail.cnu.edu.cn;
Examples
data(TibetanMoth)
data(pineMothITS2)
ref<-TibetanMoth
ref2<-pineMothITS2
out<-sample.ref(ref,sample.porp=0.5,sample.level="full")
out
out2<-sample.ref(ref2,sample.porp=0.5,sample.level="full")
out2