# NOT RUN {
library("mlr3")
po_pca = po("pca")
po_nop = po("nop")
branches = branch(pca = po_pca, nothing = po_nop)
# gives the same as
branches = c("pca", "nothing")
po("branch", branches) %>>%
gunion(list(po_pca, po_nop)) %>>%
po("unbranch", branches)
branch(pca = po_pca, nothing = po_nop,
.prefix_branchops = "br_", .prefix_paths = "xy_")
# gives the same as
po("branch", branches, id = "br_branch") %>>%
gunion(list(xy_pca = po_pca, xy_nothing = po_nop)) %>>%
po("unbranch", branches, id = "br_unbranch")
# }
Run the code above in your browser using DataCamp Workspace