Description Usage Arguments Details Value Examples
This is a wrapper around parallel::mclapply
. It supports different
options for handling errors and warnings on nodes.
1 2 3 | mcMap(x, f, ..., errors = getErrorsOption(),
warnings = getWarningsOption(),
warningsWhitelist = getWarningsWhitelist(), finallyStop = FALSE)
|
x |
(vector) a vector to iterate over |
f |
(function) |
... |
arguments passed to |
errors |
(character) one in |
warnings |
(character) one in |
warningsWhitelist |
(character) a vector of regular expressions for white-listing warnings. |
finallyStop |
(logical) if we want to raise an error if any of the nodes produced one. |
This implementation has the same limitations as mclapply
: GUIs (like
RStudio) do not handle console output well. As the documentation of
mclapply
already states: this function is not designed for
interactive sessions.
The arguments errors
and warnings
control how errors and
warnings are dealt with. When warnings = "asError"
is specified,
warnings are escalated into errors unless they are on the whitelist, which,
by default, is empty.
Unlike mclapply
not an object of class 'try-error' is
returned, but a simpleError in case of errors. This is also the case
when warnings are errors.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.