Learn R Programming

drake (version 5.3.0)

render_static_drake_graph: Render a static ggplot2/ggraph visualization from drake_graph_info() output.

Description

This function requries packages ggplot2 and ggraph. Install them with install.packages(c("ggplot2", "ggraph")).

Usage

render_static_drake_graph(graph_info, main = graph_info$default_title)

Arguments

graph_info

list of data frames generated by drake_graph_info(). There should be 3 data frames: nodes, edges, and legend_nodes.

main

character string, title of the graph

Value

A ggplot2 object, which you can modify with more layers, show with plot(), or save as a file with ggsave().

See Also

vis_drake_graph(), sankey_drake_graph(), static_drake_graph()

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_mtcars_example() # Get the code with drake_example("mtcars").
# Instead of jumpting right to vis_drake_graph(), get the data frames
# of nodes, edges, and legend nodes.
config <- drake_config(my_plan) # Internal configuration list
static_drake_graph(config) # Jump straight to the static graph.
# Get the node and edge info that vis_drake_graph() just plotted:
graph <- drake_graph_info(config)
render_static_drake_graph(graph)
})
# }

Run the code above in your browser using DataLab