extract_shuffle_params function

Extract relevant parameters from a generic shuffle function output

Extract relevant parameters from a generic shuffle function output

Any shuffling function should return one of the following:

  1. atomic index vector for a direct location assignment
  2. a list with src and dst vector
  3. a list with locations vector (for location assignment) and optional sample_attr data frame/tibble
extract_shuffle_params(shuffle, attributes_expected)

Arguments

  • shuffle: Return value of a shuffle function
  • attributes_expected: Logical; if TRUE, sample attributes are expected from the shuffling result and the function dies if they are not provided.

Returns

A list with components src, dst, location_assignment and samples_attr, depending on the output of the specific shuffling function

Details

This function parses the output, performs a few checks and returns results in a simple-to-use list.