This creates a very thin wrapper around the function and can store additional arguments, but does not do anything more..

SBC_generator_custom(f, ...)



function accepting at least an n_datasets argument and returning and SBC_datasets object


Additional arguments passed to f



gen <- SBC_generator_custom(f, <<some other args>>)
datasets <- generate_datasets(gen, n_datasets = my_n_datasets)

is equivalent to just running

datasets <- f(<<some other args>>, n_datasets = my_n_datasets)

So whenever you control the code calling generate_datasets, it usually makes more sense to just create an SBC_datasets object directly and avoid using SBC_generator_custom and generate_datasets at all. SBC_generator_custom can however be useful, when a code you do not control calls generate_datasets for you and the built-in generators do not provide you with enough flexibility.