Use DecisionTwig to build and modify twig R code available on CRAN and GitHub.
A good place to start is going through the vignettes on GitHub.
You can use [Load Example] which loads a simple twig code. Then, press [Generate Twig] to populate the model on the left. Once done, press [Generate Code] to update the R code.
Quick instructions:
To link two shapes place the cursor on one shape and then drag it to the next shape.
To remove a shape or arrow (link), select it and then press delete (Fn+Delete) on Mac or Del on PC.
An edge (arrow) must have two text entries. First line is the Option, and the second line is the
probability of that Option (prob). Use the Return (Mac) or Enter (PC) key to separate the two text entries.