0

I have a test.gv file with nodes and edges like

digraph a_nice_graph {
  
  # node definitions with substituted label text
  node [fontname = Helvetica]
  a [label = '@@1'parti = acteur]
  b [label = '@@2-1' parti = acteur]
  c [label = '@@2-2' parti = acteur]
  d [label = '@@2-3' parti = resource]
  e [label = '@@2-4' parti = resource]
  f [label = '@@2-5' parti = resource]
  g [label = '@@2-6' parti = resource]
  h [label = '@@2-7' parti = resource]
  i [label = '@@2-8' parti = resource]
  j [label = '@@2-9' parti = resource]
  
  # edge definitions with the node IDs
  a -> {d e f g h i j}
  b -> {a d e f g h i j}
  c -> {d e f g h i j}
}

readable with DiagrammeR::grViz("/tmp/test.gv")

exemple graph

I would like to manipulate the objects (node and edges) with the functions of the DiagrammR package to make subgraphs according to the attributes. I don't understand how to put my objects in a variable and then manipulate them.

delaye
  • 1,357
  • 27
  • 45
  • Can we select nodes in diagrammer::grviz graphs inside R? I have never heard about it... – manro Nov 11 '21 at 15:35
  • I don't know but in the package I have a [select_nodes](https://rich-iannone.github.io/DiagrammeR/selections.html) function. So I expected it to be possible. – delaye Nov 11 '21 at 19:06
  • yes, but it works for not grviz graphs. https://rdrr.io/cran/DiagrammeR/man/select_nodes.html – manro Nov 11 '21 at 19:08

0 Answers0