mixture_draw: Separate a chosen proportion of a reference dataset into a mixture with known population proportions
Description
Takes a reference dataset and a set of population proportions, either at the collection
or reporting unit level. Randomly samples individuals to satisfy these desired proportions,
and splits them into a new "mixture" dataframe.
mixture_draw returns a list of two data frames,
"mixture" being the random sample taken, and "reference" being the remaining samples
Arguments
D
a two-column genetic dataframe with "indiv", "repunit", and "collection" columns
rhos
a vector of the desired reporting unit proportions in the mixture set;
if not named, will be assumed to be ordered by order of appearance in the dataset
omegas
the desired collection proportions in the mixture set
N
the total size of the mixture set
min_remaining
the fraction of any collection in the reference dataset which must remain
at the end of the draw