Description Usage Arguments Details Value Author(s) Examples
Manually add symbol names to the worker environment export list.
1 |
names |
A vector of symbol names to export. |
The setExport function lets users manually declare symbol names of corresponding objects that should be exported to workers.
The foreach
function includes a similar .export
parameter.
We provide this supplemental export option for users without direct access
to the foreach
function, for example, when foreach
is used
within a package.
Nothing is returned.
B. W. Lewis <blewis@illposed.net>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
require("doRedis")
registerDoRedis("work queue")
startLocalWorkers(n=1, queue="work queue")
f <- function() pi
foreach(1)
# Returns the error:
# Error in eval(call("f")) : task 1 failed - could not find function "f"
# Manuall export the symbol f:
setExport("f")
foreach(1)
# Ok then.
#[[1]]
#[1] 3.141593
removeQueue("work queue")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.