sample.ref: Sample Random Datasets from References (DNAbin)

Description Usage Arguments Value Note Author(s) References Examples

View source: R/sample.ref.R

Description

Randomly sample reference data at different levels of taxon.

Usage

1
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

1
2
3
4
5
6
7
8
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

BarcodingR documentation built on April 14, 2020, 6:04 p.m.