# NOT RUN {
# Here is a fake batchable process
fake_process <- function(file) {
message("Processing ", file, "...")
flush.console()
Sys.sleep(0.5)
if (runif(1) > 0.7) { # Fails
warning("fake_process was unable to process ", file)
invisible(FALSE)
} else invisible(TRUE)
}
# Run it in batch mode on five items
files <- paste0("file", 1:5)
batch(files, fake_process)
# }
Run the code above in your browser using DataLab