Learn R Programming

BarcodingR (version 1.0-3)

sample.ref: 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.

References

zhangab2008(at)mail.cnu.edu.cn;

Examples

Run this code
# NOT RUN {
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


# }

Run the code above in your browser using DataLab