Takes an arbitrary amount of Graph
s or PipeOp
s (or objects that can be automatically
converted into Graph
s or PipeOp
s, see as_graph()
and as_pipeop()
) as inputs and joins
them in a serial Graph
, as if connecting them using %>>%
.
Care is taken to avoid unnecessarily cloning of components. A call of
chain_graphs(list(g1, g2, g3, g4, ...), in_place = FALSE)
is equivalent to
g1 %>>% g2 %>>!% g3 %>>!% g4 %>>!% ...
.
A call of chain_graphs(list(g1, g2, g3, g4, ...), in_place = FALSE)
is equivalent to g1 %>>!% g2 %>>!% g3 %>>!% g4 %>>!% ...
(differing in the
first operator being %>>!%
as well).
Arguments
- graphs
list
of (Graph
|PipeOp
|NULL
|...
)
List of elements which are theGraph
s to be joined. Elements must be convertible toGraph
orPipeOp
usingas_graph()
andas_pipeop()
.NULL
is the neutral element of%>>%
and skipped.- in_place
(
logical(1)
)
Whether to try to avoid cloning the first element ofgraphs
, similar to the difference of%>>!%
over%>>%
. This can only be avoided ifgraphs[[1]]
is already aGraph
. Beware that, ifchain_graphs()
fails because of id collisions, thengraphs[[1]]
will possibly be in an incompletely modified state whenin_place
isTRUE
.
See also
Other Graph operators:
%>>%()
,
as_graph()
,
as_pipeop()
,
assert_graph()
,
assert_pipeop()
,
greplicate()
,
gunion()
,
mlr_graphs_greplicate