drake (version 6.2.1)

prune_drake_graph: Prune the dependency network of your project.

Description

igraph objects are used internally to represent the dependency network of your workflow. See drake_config(my_plan)$graph from the mtcars example.

Usage

prune_drake_graph(graph, to = igraph::V(graph)$name, jobs = 1)

Arguments

graph

An igraph object to be pruned.

to

Character vector, names of the vertices that draw the line for pruning. The pruning process removes all vertices downstream of to.

jobs

Number of jobs for light parallelism (on non-Windows machines).

Value

A pruned igraph object representing the dependency network of the workflow.

Details

For a supplied graph, take the subgraph of all combined incoming paths to the vertices in to. In other words, remove the vertices after to from the graph.

See Also

drake_config(), make()

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_mtcars_example() # Get the code with drake_example("mtcars").
# Build the igraph object representing the workflow dependency network.
graph <- drake_config(my_plan)$graph
# The default plotting is not the greatest,
# but you will get the idea.
# plot(graph) # nolint
# Prune the graph: that is, remove the nodes downstream
# from 'small' and 'large'
pruned <- prune_drake_graph(graph = graph, to = c("small", "large"))
# plot(pruned) # nolint
})
# }

Run the code above in your browser using DataLab