Parallelize applying a function over a list or vector according to the registered parallelization engine.
A vector (atomic or list), or other objects suitable for the engine in use.
the function to be applied to each element of
optional arguments to
an object inheriting from class
Parallelization can be employed to speed up some of the embarrassingly
parallel computations performed in package tm, specifically
tm_map() on a non-lazy-mapped
TermDocumentMatrix() on a
be used to customize parallelization according to the available
tm_parLapply_engine() is used for getting (with no arguments)
or setting (with argument
new) the parallelization engine
employed (see below for examples).
If an engine is set to an object inheriting from class
parLapply() with this cluster and
the given arguments. If set to a function,
calls the function with the given arguments. Otherwise, it simply
Hence, parallelization via
and a default cluster registered via
setDefaultCluster() can be
or re-registering the cluster, say
(note that since R version 3.5.0, one can use
getDefaultCluster() to get
the registered default cluster). Using
gives load-balancing parallelization with the registered default or
given cluster, respectively. To achieve parallelization via forking
(on Unix-alike platforms), one can use the above with clusters created
makeForkCluster(), or use
mclapply() with the default or
n of cores.
A list the length of
X, with the result of applying
together with the
... arguments to each element of
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.