powered by
Sample k indices per levels from a factor
sample_k_per_level(y, k)
vector with indices for sample
factor; factor with levels
integer; number of indices to sample per level