Maps a function over lists or vectors in parallel.
Uses the parallelization mode and the other options specified in
Large objects can be separately exported via
they can be simply used under their exported name in slave body code.
Regarding errorhandling, see the argument
parallelMap(fun, ..., more.args = list(), simplify = FALSE, use.names = FALSE, impute.error = NULL, level = NA_character_, show.info = NA)
function] Function to map over
- [any] Arguments to vectorize over (list or vector).
list] A list of other arguments passed to
fun. Default is empty list.
logical(1)] Should the result be simplified? See
sapply. Default is
logical(1)] Should result be named by first vector if that is of class character? Default is
function(x)] This argument can be used for improved error handling.
NULLmeans that, if an exception is generated on one of the slaves, it is also thrown on the master. Usually all slave jobs will have to terminate until this exception on the master can be thrown. If you pass a constant value or a function, all jobs are guaranteed to return a result object, without generating an exception on the master for slave errors. In case of an error, this is a
simpleErrorobject containing the error message. If you passed a constant object, the error-objects will be substituted with this object. If you passed a function, it will be used to operate on these error-objects (it will ONLY be applied to the error results). For example, using
identitywould keep and return the
function(x) 99would impute a constant value (which could be achieved more easily by simply passing
99). Default is
character(1)] If a (non-missing) level is specified in
parallelStart, this call is only parallelized if the level specified here matches. Useful if this function is used in a package. Default is
logical(1)] Verbose output on console? Can be used to override setting from options /
parallelStart. Default is NA which means no overriding.
parallelStart() parallelMap(identity, 1:2) parallelStop()