I am trying to make a flow to show my experimental design. I have something that works, but I would like to add another layer at the bottom-which adds a question box to each group, which should be big enough to read. An example of what I have is image 1 hoping for is in image 2. Such that group 1 has a question and answer (with arrows) and group 2 and 3 has a question and 3 answers (with arrows). Of course, the arrows should be black and in the right place-its just hard to do in word!
Does anyone know how I can do this?
# install.packages("DiagrammeR")
#library(DiagrammeR)
schematic <- grViz("digraph lexicon {
# node definitions with substituted label text
node [fontname = Helvetica, shape = rectangle, style=filled,color=lightgrey]
tab1 [label = '@@1']
tab2 [label = '@@2']
tab3 [label = '@@3']
tab4 [label = '@@4']
tab5 [label = '@@5']
node [shape = rectangle, fillcolor=PeachPuff]
tab6 [label = '@@6']
node [shape = rectangle, fillcolor=CadetBlue]
tab7 [label = '@@7']
node [shape = rectangle, fillcolor=Lavender]
tab8 [label = '@@8']
node [fontname = Helvetica, shape = rectangle, style=bold]
m1 [label = 'Did not agree to participate n=18']
m2 [label = 'Under 18 years n=11']
m3 [label = 'No smoke in past 3 months n=8']
m4 [label = 'Did not complete survey n=155']
# creating horizontal lines
node [shape=none, width=0, height=0, label='']
{rank=same; tab1 -> m1}
{rank=same; tab2 -> m2}
{rank=same; tab3 -> m3}
{rank=same; tab4 -> m4}
# edge definitions with the node IDs
tab1 -> tab2 -> tab3 -> tab4 -> tab5->{tab6 tab7 tab8};
}
[1]: 'Raw Data n=434'
[2]: 'Agreed to participate n=406'
[3]: 'Over 18 years n=491'
[4]: 'smoke in past 3 months=403'
[5]: 'Final sample n=238'
[6]: 'Group1 n=82'
[7]: 'Group2 n=98'
[8]: 'Group3 n=88'
")
jpeg(file = "schematic.jpg")
schematic