sample.ref {BarcodingR} | R Documentation |
Randomly sample reference data at different levels of taxon.
sample.ref(ref, sample.porp = 0.5, sample.level = "full")
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"). |
a list containing the selected samples and the samples left, in DNAbin format stored in a matrix or a list.
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.
Ai-bing ZHANG, PhD. CNU, Beijing, CHINA.
zhangab2008(at)mail.cnu.edu.cn;
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