From efae70add63f6b0520b2420f62bac581516e5390 Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Wed, 5 Feb 2025 14:31:33 +0100 Subject: [PATCH] small guide tweaks --- vignettes/userguide.Rmd | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/vignettes/userguide.Rmd b/vignettes/userguide.Rmd index 48e006e..1ca3eb0 100644 --- a/vignettes/userguide.Rmd +++ b/vignettes/userguide.Rmd @@ -207,13 +207,14 @@ If we want to use a package function we need to load it on the worker using the ```{r} f1 = function(x) splitIndices(x, 3) + +# Q(f1, x=5, n_jobs=1) +# (Error #1) could not find function "splitIndices" + Q(f1, x=3, n_jobs=1, pkgs="parallel") f2 = function(x) parallel::splitIndices(x, 3) Q(f2, x=8, n_jobs=1) - -# Q(f1, x=5, n_jobs=1) -# (Error #1) could not find function "splitIndices" ``` ### As parallel `foreach` backend @@ -227,13 +228,8 @@ library(foreach) foreach(i=1:3) %do% sqrt(i) ``` -it can also perform these operations in parallel using `%dopar%`: - -```{r} -foreach(i=1:3) %dopar% sqrt(i) -``` - -The latter allows registering different handlers for parallel execution, where +It can also perform these operations in parallel using `%dopar%`: +This operator allows registering different handlers for parallel execution, where we can use `clustermq`: ```{r}