0

I would like to produce a diagram with DiagramR.

This is my code

    require(DiagrammeR)
    grViz("
    digraph boxes_and_circles {
    node [shape = box,
        fontname = Helvetica]
    A; B; C; D
    B->A C->A D->B
    }
    ")

But I get this result

enter image description here

And I need like this one

enter image description here

How can I set flow direction to up?

s__
  • 9,270
  • 3
  • 27
  • 45
jlopez
  • 335
  • 2
  • 13

1 Answers1

1

You could to set the parameter rankdir and add the color to edge and node:

library(DiagrammeR)
grViz("
    digraph boxes_and_circles {
    
        rankdir = BT
    
       node [shape = box,
             fontname = Helvetica,
             color = gray
            ]
            A; B; C; D

       edge [color = gray]
            B->A C->A D->B
      }
    ")

enter image description here

s__
  • 9,270
  • 3
  • 27
  • 45