R/permute_subgroups.R
form_homogeneous_subgroups.Rd
Form groups and subgroups of 'homogeneous' samples as defined by certain variables and size constraints
form_homogeneous_subgroups(
batch_container,
allocate_var,
keep_together_vars = c(),
n_min = NA,
n_max = NA,
n_ideal = NA,
subgroup_var_name = NULL,
prefer_big_groups = TRUE,
strict = TRUE
)
Batch container with all samples assigned that are to be grouped and sub-grouped
Name of a variable in the samples
table to inform possible groupings, as (sub)group sizes must add up to the correct totals
Vector of column names in sample table; groups are formed by pooling samples with identical values of all those variables
Minimal number of samples in one sub(!)group; by default 1
Maximal number of samples in one sub(!)group; by default the size of the biggest group
Ideal number of samples in one sub(!)group; by default the floor or ceiling of mean(n_min,n_max)
, depending on the setting of prefer_big_groups
An optional column name for the subgroups which are formed (or NULL)
Boolean; indicating whether or not bigger subgroups should be preferred in case of several possibilities
Boolean; if TRUE, subgroup size constraints have to be met strictly, implying the possibility of finding no solution at all
Subgroup object to be used in subsequent calls to compile_possible_subgroup_allocation()