View source: R/shuffle_samples.R
mk_swapping_function | R Documentation |
If length(n_swaps)==1
, the returned function may be called an arbitrary number of times.
If length(n_swaps)>1
and called without argument, the returned function may be called length(n_swaps) timed before returning NULL, which would be the stopping criterion if all requested swaps have been exhausted. Alternatively, the function may be called with an iteration number as the only argument, giving the user some freedom how to iterate over the sample swapping protocol.
mk_swapping_function(n_swaps = 1)
n_swaps |
Vector with number of swaps to be proposed in successive calls to the returned function (each value should be in valid range from 1.. |
Function to return a list with length n vectors src
and dst
, denoting source and destination index for the swap operation, or NULL if the user provided a defined protocol for the number of swaps and the last iteration has been reached.
data("invivo_study_samples")
bc <- BatchContainer$new(
dimensions = c("plate" = 2, "column" = 5, "row" = 6)
)
scoring_f <- osat_score_generator("plate", "Sex")
optimize_design(
bc, scoring = scoring_f, invivo_study_samples,
max_iter = 100,
shuffle_proposal_func = mk_swapping_function(1)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.