pa_walk2 | R Documentation |
The syntax and the logic of pa_walk functions are the identical to purrr's
walk function. Please refer to map2
if you are not
familiar with purrr mapping style. Except .x, .y, .f, other arguments are
optional and control the parallelization processes. They will be handled
to foreach function and the selected forreach adaptor.
pa_walk2( .x, .y, .f, ..., cores = NULL, adaptor = "doParallel", cluster_type = NULL, splitter = NULL, auto_export = TRUE, .export = NULL, .packages = NULL, .noexport = NULL, .errorhandling = "stop", .inorder = TRUE, .verbose = FALSE )
.x |
Vectors of the same length. A vector of length 1 will be recycled. |
.y |
Vectors of the same length. A vector of length 1 will be recycled. |
.f |
A function, formula, or vector (not necessarily atomic). If a function, it is used as is. If a formula, e.g.
This syntax allows you to create very compact anonymous functions. If character vector, numeric vector, or list, it is
converted to an extractor function. Character vectors index by
name and numeric vectors index by position; use a list to index
by position and name at different levels. If a component is not
present, the value of |
... |
Additional arguments passed on to the mapped function. |
cores |
(Optional) Number of cores (i.e. workers) to be used. The default value is: Available CPU cores - 1 |
adaptor |
The foreach adaptor to be used. Available options are:
|
cluster_type |
The Clusters architecture to be used with the selected adaptor. Note that allowed values for this argument depends on the "adaptor" argument:
|
splitter |
(Optional) Explicitly instruct parapurrr how to pass your input elements to the workers. Splitter should be alist where each of its elements is a vector of integers or integer-like numbers (i.e. no decimal points) of the indexes of your input elements. Collectively they should have a one-to-one correspondence with .x indexes. See the Vignettes for further explanation and examples. |
auto_export |
(TRUE (default), FALSE or "all") Should parapurrr export the detected objects used in .f, from the function's calling frame to the workers? Default is set to TRUE for convenience, but to improve the performance, consider turning auto_export off and manually supply the exported variables using .export argument. "all" is the most conservative and yet, potentially resource-demanding option. It will clone the function's calling environment, and export every variable to the workers, whether used or not. |
.export |
character vector of variables to export.
This can be useful when accessing a variable that isn't defined in the
current environment.
The default value in |
.packages |
character vector of packages that the tasks depend on.
If |
.noexport |
character vector of variables to exclude from exporting.
This can be useful to prevent variables from being exported that aren't
actually needed, perhaps because the symbol is used in a model formula.
The default value in |
.errorhandling |
specifies how a task evaluation error should be handled.
If the value is "stop", then execution will be stopped via
the |
.inorder |
logical flag indicating whether the |
.verbose |
logical flag enabling verbose messages. This can be very useful for trouble shooting. |
Note that except cores, cluster_type, and adaptor, documentation of other arguments, return section, and examples section are automatically imported from purrr and foreach packages.
An atomic vector, list, or data frame, depending on the suffix.
Atomic vectors and lists will be named if .x
or the first
element of .l
is named.
If all input is length 0, the output will be length 0. If any input is length 1, it will be recycled to the length of the longest.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.