Search code examples
rflowchart

adding title to a flowchart in R


I am havingbelow lines

library(DiagrammeR)

grViz("                          
digraph {    
     graph [layout = dot,
     rankdir = TB,
     overlap = true,
     fontsize = 10,
     title='title']

All parameters are okay except the title does not show, wondering how should I go about it? Many thanks.


Solution

  • Try adding this as label instead of title, see if it works for you:

     library(DiagrammeR)
     chart<- graph [layout = dot,
         rankdir = TB,
         overlap = true,
         fontsize = 10,
         label='title']
    

    EDIT BASED ON COMMENTS:

    I believe adding the render statement to the object will get you there, but you may need to tweak how you create the object chart

    chart%>% render_graph(title = "Title")