Description Usage Arguments Details Value
Determine if a for loop can be parallelized, and if so transform it into
a call to lapply
. This first version will modify loops if and
only if the body of the loop does not do any assignments at all.
1 | forLoopToLapply(forloop)
|
forloop |
R language object with class |
Recommended use case:
The functions in the body of the loop write to different files on each loop iteration.
The generated code WILL FAIL if:
Code in the body of the loop is truly iterative. Functions update global state in any way other than direct assignment.
call R call to parallel::mclapply
if successful,
otherwise the original forloop.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.