R/permute_subgroups.R
shuffle_grouped_data.Rd
Generate in one go a shuffling function that produces permutations with specific constraints on multiple sample variables and group sizes fitting one specific allocation variable
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
Vector of column names in sample table; items with identical values in those variables will not be put into the same subgroup if at all possible
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, if TRUE, add an attribute table to the permutation functions' output, to be used in scoring during the design optimization
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
Boolean: Enforce full search of the possibility tree, independent of the value of maxCalls
Maximum number of recursive calls in the search tree, to avoid long run times with very large trees
Shuffling function that on each call returns an index vector for a valid sample permutation