could you please suggest a way to assign the title to the consort diagram generated using DiagrammeR package. Also i tried to color the boxes of all the nodes using fillcolor=blue in the node, but that does not seem to work,
library(tidyCDISC)
library(tidyverse)
library(ggalluvial)
library(DiagrammeR)
data('adsl', package='tidyCDISC')
# randomized population
pop1 <- adsl %>% rename_all(tolower) %>% filter(saffl=='Y') %>% count() %>%
mutate(col1=paste0('Safety Population\n(N=',n,')'))
popt <- adsl %>% rename_all(tolower) %>% filter(saffl=='Y') %>% group_by(trt01a) %>% count() %>%
mutate(col1=paste0(trt01a,'\n(N=',n,')'))
DiagrammeR::grViz("
digraph box {
graph [layout=dot, overlap = true, fontsize = 10]
node [shape=box, fontname = Helvetica, color = blue, fillcolor = red]
total_population [label = '@@1'];
placebo [label = '@@2'];
xanomeline_low_dose [label = '@@3'];
xanomeline_high_dose [label = '@@4'];
total_population -> placebo total_population -> xanomeline_low_dose total_population -> xanomeline_high_dose
}
[1]: pop1$col1
[2]: popt$col1[1]
[3]: popt$col1[3]
[4]: popt$col1[2]
")