drake_graph_info {drake} | R Documentation |
Prepare the workflow graph for visualization
Description
With the returned data frames,
you can plot your own custom visNetwork
graph.
Usage
drake_graph_info(
...,
from = NULL,
mode = c("out", "in", "all"),
order = NULL,
subset = NULL,
build_times = "build",
digits = 3,
targets_only = FALSE,
font_size = 20,
from_scratch = FALSE,
make_imports = TRUE,
full_legend = FALSE,
group = NULL,
clusters = NULL,
show_output_files = TRUE,
hover = FALSE,
on_select_col = NULL,
config = NULL
)
Arguments
... |
Arguments to |
from |
Optional collection of target/import names.
If |
mode |
Which direction to branch out in the graph
to create a neighborhood around |
order |
How far to branch out to create
a neighborhood around |
subset |
Optional character vector.
Subset of targets/imports to display in the graph.
Applied after |
build_times |
Character string or logical.
If character, the choices are
1. |
digits |
Number of digits for rounding the build times |
targets_only |
Logical, whether to skip the imports and only include the targets in the workflow plan. |
font_size |
Numeric, font size of the node labels in the graph |
from_scratch |
Logical, whether to assume all the targets
will be made from scratch on the next |
make_imports |
Logical, whether to make the imports first.
Set to |
full_legend |
Logical. If |
group |
Optional character scalar, name of the column used to
group nodes into columns. All the columns names of your original |
clusters |
Optional character vector of values to cluster on.
These values must be elements of the column of the |
show_output_files |
Logical, whether to include
|
hover |
Logical, whether to show text (file contents, commands, etc.) when you hover your cursor over a node. |
on_select_col |
Optional string corresponding to the column name
in the plan that should provide data for the |
config |
Deprecated. |
Value
A list of three data frames: one for nodes, one for edges, and one for the legend nodes. The list also contains the default title of the graph.
See Also
Examples
## Not run:
isolate_example("Quarantine side effects.", {
if (requireNamespace("visNetwork", quietly = TRUE)) {
if (suppressWarnings(require("knitr"))) {
load_mtcars_example() # Get the code with drake_example("mtcars").
vis_drake_graph(my_plan)
# Get a list of data frames representing the nodes, edges,
# and legend nodes of the visNetwork graph from vis_drake_graph().
raw_graph <- drake_graph_info(my_plan)
# Choose a subset of the graph.
smaller_raw_graph <- drake_graph_info(
my_plan,
from = c("small", "reg2"),
mode = "in"
)
# Inspect the raw graph.
str(raw_graph)
# Use the data frames to plot your own custom visNetwork graph.
# For example, you can omit the legend nodes
# and change the direction of the graph.
library(visNetwork)
graph <- visNetwork(nodes = raw_graph$nodes, edges = raw_graph$edges)
visHierarchicalLayout(graph, direction = 'UD')
}
}
})
## End(Not run)