Description Usage Arguments Value Examples
Build a diagram of a optree pipeline.
1 | op_diagram(optree, ..., merge_tables = FALSE, show_table_columns = TRUE)
|
optree |
operation tree pipeline (or list of such). |
... |
force other argument to be by name. |
merge_tables |
logical, if TRUE merge all same table references into one node. rel_op nodes that declare a materialize_as name will be cross-linked. |
show_table_columns |
logical, if TRUE show table columns. |
character DiagrammeR::grViz() ready text.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | d <- mk_td('d',
columns = qc(AUC, R2))
optree <- d %.>%
extend(., v %:=% ifelse(AUC>0.5, R2, 1.0)) %.>%
quantile_node(.) %.>%
natural_join(., d, jointype = "LEFT", by = "AUC") %.>%
orderby(., "AUC")
cat(format(optree))
cat(op_diagram(optree))
if(requireNamespace("DiagrammeR", quietly = TRUE)) {
optree %.>%
op_diagram(., merge_tables = TRUE) %.>%
DiagrammeR::grViz(.) %.>%
print(.)
# # or to render to png
# optree %.>%
# op_diagram(., merge_tables = TRUE) %.>%
# DiagrammeR::DiagrammeR(diagram = ., type = "grViz") %.>%
# DiagrammeRsvg::export_svg(.) %.>%
# charToRaw(.) %.>%
# rsvg::rsvg_png(., file = "diagram1.png")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.