Description Usage Arguments Value Note Examples
create vector of indices constituting a stratified sample using a discrete variable to partition strata
1 | stratsampInds(strata, nperstrat = 300)
|
strata |
atomic vector |
nperstrat |
size of sample to be retrieved |
numeric vector of indices
fails if any stratum has size less than 'nperstrat'
1 2 3 4 5 | mytags = c(1,1,1,2,2,3,1,1,1,2,2,3,3,3,3,2,2,2)
mydat = 1:length(mytags)
names(mydat) = mytags
inds = stratsampInds(mytags, nperstrat=2)
mydat[inds]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.