batch_process | R Documentation |
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),
...
)
fun |
A function to process each of the files.
|
path |
A string of the path to the directory with the files for processing. |
regexp |
A string of a regular expression. Only non-hidden file names which match the regular expression will be batch processed. |
recurse |
A flag specifying whether to recurse into path's subdirectories. |
progress |
A flag specifying whether to print a progress bar. |
force |
A flag specifying whether to delete configuration and log files even if there are files remaining to be processed. |
report |
A flag specifying whether to outputs a report of the status of individual files to the console. |
seeds |
A named list of the L'Ecuyer-CMRG seed to use for each
file. If |
options |
The future specific options to use with the workers.
seed must be |
ask |
A flag specifying whether to ask before starting to process the files. |
... |
Additional arguments passed to |
An invisible flag indicating whether all the files where successfully processed.
batch_config()
, batch_run()
and batch_cleanup()
path <- tempdir()
write.csv(mtcars, file.path(path, "file1.csv"))
batch_process(function(x) TRUE, path, regexp = "[.]csv$", ask = FALSE)
unlink(file.path(path, "file1.csv"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.