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 new Graph
.
The PipeOp
s of the input Graph
s are not joined with new edges across
Graph
s, so if length(graphs) > 1
, the resulting Graph
will be disconnected.
This operation always creates deep copies of its input arguments, so they cannot be modified by reference afterwards.
To access individual PipeOp
s after composition, use the resulting Graph
's $pipeops
list.
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
values automatically get converted toPipeOpNOP
with a random ID of the formatnop_********
. The list can be named, in which case the IDs of the elements are prefixed with the names, separated by a dot (.
).- in_place
(
logical(1)
|logical
)
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
.
Unlikechain_graphs()
,gunion()
does all checks before mutatinggraphs[[1]]
, so it will not leavegraphs[[1]]
in an incompletely modified state when it fails.in_place
may also be of lengthgraph
, in which case it determines for each element ofgraphs
whether it is cloned. This is for internal usage and is not recommended.
See also
Other Graph operators:
%>>%()
,
as_graph()
,
as_pipeop()
,
assert_graph()
,
assert_pipeop()
,
chain_graphs()
,
greplicate()
,
mlr_graphs_greplicate