Skip to content

Commit

Permalink
small guide tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Feb 5, 2025
1 parent 2a7e5e7 commit 2c4153f
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions vignettes/userguide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@ 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
Expand All @@ -227,13 +227,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}
Expand Down

0 comments on commit 2c4153f

Please sign in to comment.