1

I'd like to exclude nodes representing functions imported from external packages (e.g. stringr::str_sub) from the graph visualization of my Drake plan, but keep the nodes for functions that come from scripts I've sourced into the environment. How would I do that?

I'm only wanting to change the way the graph is displayed visually, since that will help me explain the workflow to other users. I don't want to impact how the plan is executed.

landau
  • 5,636
  • 1
  • 22
  • 50
rushgeo
  • 103
  • 6

1 Answers1

1

https://ropenscilabs.github.io/drake-manual/vis.html#subgraphs has some examples. The visualization functions have arguments targets_only, from, mode, order, and subset to let you omit certain nodes. Does that help?

landau
  • 5,636
  • 1
  • 22
  • 50
  • As a side note, I regret the decision to track namespaced objects from packages to begin with. `packrat` and `pkgenv` are categorically superior solutions to package reproducibility. If some future release of `drake` ever invalidates existing targets anyway, I will throw in a patch to remove this behavior. – landau Apr 19 '19 at 23:04
  • Thanks! I got the behavior I was seeking by using the names of the config's layout list, which excludes the namespaced objects: `my_config <- drake_config(my_plan)` `vis_drake_graph(my_config, from = names(my_config$layout))` – rushgeo Apr 22 '19 at 22:14
  • Glad that worked for you. Just so you are aware, `names(config$list)` also excludes files. If you want to add those back, you can have a look at `drake_graph_info(config)$nodes`. – landau Apr 23 '19 at 17:31