View source: R/parallel_helpers.R
| run_parallel | R Documentation |
Small wrapper that hides the branching between the two back-ends. It always returns a **named list** whose names are identical to the names of the input split list. This guarantees that 'unlist()' produces the same named vector for both back-ends, which is required by the unit tests.
run_parallel(
X,
FUN,
backend = c("parallel", "future"),
use_threads = NULL,
cl = NULL,
...
)
X |
List (or vector) of inputs that will be split among the workers. |
FUN |
Function that will be executed on each chunk. |
backend |
Either "parallel" or "future". |
use_threads |
Number of workers (relevant for both back-ends). |
cl |
Optional cluster object created with |
List of results (identical to the output of 'parLapply' / 'future_lapply'). The list is **named** - the names are taken from the split index ('split_idx').
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.