Make Flowchart in R

Master R

By Guangming Lang Comment

I had to draw some flowcharts to demo the pipeline I built for a client. I was very pleased to discover DiagrammeR. It allows you to make flowcharts and many other diagrams using R. Below is a simple example.

library(DiagrammeR)
grViz("digraph a_nice_graph {
        
        # node definitions with substituted label text
        node [fontname = Helvetica, shape = rectangle]        
        rec1 [label = '@@1']
        rec2 [label = '@@2']
        rec3 [label = '@@5']

        node [fontname = Helvetica, shape = oval]
        ova1 [label = '@@3']
        ova2 [label = '@@4']

        # edge definitions with the node IDs
        rec1 -> ova1 -> rec2 -> ova2 -> rec3
        }
      
        [1]: 'raw data'
        [2]: 'cleaned data'
        [3]: 'clean and tidy'
        [4]: 'describe'
        [5]: 'report'
      ")

center

If you enjoyed this post, get updates. It's FREE