powered by
stratsample(strata, counts)
as.character(strata)
strata
sample
The "sampling" package has many more sampling algorithms.
data(api) s<-stratsample(apipop$stype, c("E"=5,"H"=4,"M"=2)) table(apipop$stype[s])
Run the code above in your browser using DataLab