simulate_sample_groups {Corbi} | R Documentation |
Simulate sample groups from given samples with labels
Description
Generate sample groups with desired labels and sizes from given sample labels.
Usage
simulate_sample_groups(labels, groups, sizes, replace = FALSE)
Arguments
labels |
a vector containing the label of each sample in the pool. |
groups |
a vector containing the desired label of samples in each group.
The label must be available in the sample pool provided by |
sizes |
integer vector indicating the desired number of samples in each group.
The length must be either one or the same as |
replace |
logical variable indicating whether sampling is with replacement. |
Value
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.
[Package Corbi version 0.6-2 Index]