This function generates stratified bootstrap samples based on the groupings and additional factors in the metadata. The function ensures that samples are drawn proportionally based on strata defined by the interaction of factor columns in the metadata.

bootstrapSamples_limRots(niter, meta.info, group.name)

Arguments

niter

Integer. The number of bootstrap samples to generate.

meta.info

Data frame. Metadata containing sample information, where each row corresponds to a sample. Factor columns in meta.info are used to define strata for sampling.

group.name

Character. The name of the column in meta.info that defines the grouping variable for the samples.

Value

A matrix of dimension niter x n, where n is the number of samples. Each row corresponds to a bootstrap sample, and each entry is a resampled row name from the metadata, stratified by group and additional factors.

Details

The function works by first identifying the factors in the meta.info data frame that are used to create strata for sampling. Within each group defined by group.name, the function samples according to the strata proportions, ensuring that samples are drawn from the correct groups and strata in a proportional manner.