0

I have this R code:

dataset %>%
   process_map()

Is there way to get the DOT notational of this output and save it as a gv file? Just for comparison, in python, Digraph.save generates a DOT file of the graph.

MrFlick
  • 195,160
  • 17
  • 277
  • 295
seke
  • 71
  • 6
  • 1
    What do you even *mean* by "DOT notational of this output"? What output? Please give a [mcve]. See [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269/4996248) for what this would mean in R. – John Coleman Jul 16 '21 at 23:54
  • If you are using the `processmapR` package, you should specify. In that package, the documentation for `process_map` describes an optional parameter `render` which, if set to `FALSE`, will cause the function to emit an an object of type `dgr_graph`. Given such an object, the package `DiagrammeR` should be able to generate a `DOT` file for it (perhaps using a function called `generate_dot()`, if I read [this answer](https://stackoverflow.com/a/67673698/4996248) correctly). – John Coleman Jul 17 '21 at 00:19

1 Answers1

1

With the help of John Colman's response, I think the answer is

pg <- process_map(dataset, render = FALSE)
DiagrammeR::generate_dot(pg) %>% cat(file = "~/dot.gv")

And looks like it's working as expected so far...

seke
  • 71
  • 6