Description Usage Arguments Details Value Examples
View source: R/split-parapply.R
A Split-Apply-Combine strategy to parallelize the evaluation of a function.
1 2 3 4 5 6 7 8 9 10 |
FUN |
The function to be applied to each subset matrix. |
ind |
Initial vector of indices that will be splitted in |
... |
Extra arguments to be passed to |
.combine |
Function to combine the results with |
ncores |
Number of cores to use. Default uses |
nb_split |
Number of blocks. Default uses |
opts_cluster |
Optional parameters for clusters passed as a named list.
E.g., you can use |
.costs |
Vector of costs (e.g. proportional to computation time)
associated with each element of |
This function splits indices in parts, then apply a given function to each part and finally combine the results.
Return a list of ncores
elements, each element being the result of
one of the cores, computed on a block. The elements of this list are then
combined with do.call(.combine, .)
if .combined
is not NULL
.
1 2 3 4 5 6 7 8 9 | ## Not run:
str(
split_parapply(function(ind) {
sqrt(ind)
}, ind = 1:10000, ncores = 2)
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.