extract_shuffle_params: Extract relevant parameters from a generic shuffle function...

View source: R/optimize.R

extract_shuffle_paramsR Documentation

Extract relevant parameters from a generic shuffle function output

Description

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

Usage

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.

Details

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

Value

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


designit documentation built on May 29, 2024, 12:04 p.m.