Generate sample groups with desired labels and sizes from given sample labels.
simulate_sample_groups(labels, groups, sizes, replace = FALSE)
a vector containing the label of each sample in the pool.
a vector containing the desired label of samples in each group.
The label must be available in the sample pool provided by labels
.
integer vector indicating the desired number of samples in each group.
The length must be either one or the same as groups
.
logical variable indicating whether sampling is with replacement.
This function will return a list with the same length as groups
.
Each component is a vector containing the indexes of samples that are sampled for
the corresponding group.