Takes an arbitrary amount of Graphs or PipeOps (or objects that can be automatically
converted into Graphs or PipeOps, 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
listof (Graph|PipeOp|NULL|...)
List of elements which are theGraphs to be joined. Elements must be convertible toGraphorPipeOpusingas_graph()andas_pipeop().NULLis 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_placeisTRUE.
See also
Other Graph operators:
%>>%(),
as_graph(),
as_pipeop(),
assert_graph(),
assert_pipeop(),
greplicate(),
gunion(),
mlr_graphs_greplicate
