View source: R/sample.by.int.R
sample.by.int | R Documentation |
Indices of Stratified Sampling
sample.by.int(f, ...)
f |
factor |
... |
potential parameters of sample.int |
End user should use interaction to combine multiple factors.
Function sample.by.int returns an integer vector.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.