Description Usage Arguments Constructors Methods Internal Class Fields and Methods Author(s) See Also Examples
A Consumer
to route incoming tasks through nodes
connected as a directed acyclic graph.
1 2 3 4 5 6 |
x |
A matrix or data.frame with columns ‘From’,
‘To’, or a |
... |
For For |
dagParam |
A |
teamParam |
A |
y |
Unused. |
Use DAGParam
and DAGTeam
to construct instances of these
classes, with ParallelParam
instances created by, e.g.,
MulticoreParam
.
See Consumer
Methods.
Internal fields of this class are are described with, e.g.,
getRefClass("MulticoreTeam")$fields
.
Internal methods of this class are described with
getRefClass("MulticoreTeam")$methods()
and
getRefClass("MulticoreTeam")$help()
.
Martin Morgan mtmorgan@fhcrc.org
Team
applies a single function across multiple threads..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | df <- data.frame(From = c("A", "A", "B", "C"),
To = c("B", "C", "D", "D"),
stringsAsFactors=FALSE)
dagParam <- DAGParam(df)
dteam <- DAGTeam(A=FunctionConsumer(function(y) y),
B=FunctionConsumer(function(A) -A),
C=FunctionConsumer(function(A) 1 / A),
D=FunctionConsumer(function(B, C) B + C),
dagParam=dagParam)
plot(dteam)
strm <- Stream(Seq(to=10), dteam)
sapply(strm, c)
reset(strm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.