powered by
Indices of Stratified Sampling
sample.by.int(f, ...)
Function sample.by.int returns an integer
vector.
factor
potential parameters of sample.int
End user should use interaction to combine multiple factors.
dplyr::slice_sample
id1 = sample.by.int(state.region, size = 2L) state.region[id1] id2 = sample.by.int(f = with(npk, interaction(N, P)), size = 2L) npk[id2, c('N', 'P')] # each combination selected 2x
Run the code above in your browser using DataLab