samp_sub | R Documentation |
Select random samples from each group
Select random samples from each group.
samp_sub(x, k, n = 10)
x |
a character string or factor indicating class info. |
k |
number of samples selected from each class. |
n |
number of replicates. |
a selected index.
cls <- iris[, 5, drop = TRUE]
(tmp <- samp_sub(cls,k = 6, n = 2))
cls[tmp[[1]]]
table(cls[tmp[[1]]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.