Performs batch processing of files in a directory using the
batch_config()
, batch_run()
and batch_cleanup()
functions.
For more control the user should call these three functions instead.
batch_process(
fun,
path,
regexp = ".*",
recurse = FALSE,
progress = FALSE,
force = TRUE,
report = TRUE,
seeds = NULL,
options = furrr::furrr_options(),
ask = getOption("batchr.ask", TRUE),
...
)
A function to process each of the files.
fun
's first argument should be a string of the path to a single file.
If processing is unsuccessful fun
should return FALSE
or throw an error (error messages are caught and automatically logged).
If fun deletes or modifies the file then it is no longer considered
for processing.
A string of the path to the directory with the files for processing.
A string of a regular expression. Only non-hidden file names which match the regular expression will be batch processed.
A flag specifying whether to recurse into path's subdirectories.
A flag specifying whether to print a progress bar.
A flag specifying whether to delete configuration and log files even if there are files remaining to be processed.
A flag specifying whether to outputs a report of the status of individual files to the console.
A named list of the L'Ecuyer-CMRG seed to use for each
file. If NULL
then seeds
is batch_seeds(files)
.
The future specific options to use with the workers.
seed must be FALSE
.
A flag specifying whether to ask before starting to process the files.
Additional arguments passed to fun
.
An invisible flag indicating whether all the files where successfully processed.