View source: R/SOptim_UnsupervisedClassification.R
StRS | R Documentation |
An auxiliar function to perform stratified random sampling of a set of integers.
StRS(x, strata, nsps)
x |
Vector of integer indices |
strata |
A vector containing the stratum number/code for each element of |
nsps |
An object of class |
A vector of indices with the selected elements of x
.
sample
st <- sample(1:5,1000,replace=TRUE)
tb <- table(st)/length(st)
ind <- 1:1000
nsps <- numSampPerStrata(propStrata=tb, n=100, minSamp = TRUE, minSizeSet = 10)
StRS(x = ind, strata = st, nsps = nsps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.