I can create this nice diagram using DiagrammeR:
DiagrammeR::grViz("digraph {
graph [layout = dot, rankdir = TB]
node [shape = rectangle]
rec1 [label = 'Step 1. Wake up']
rec2 [label = 'Step 2. Write code']
rec3 [label = 'Step 3. ???']
rec4 [label = 'Step 4. PROFIT']
# edge definitions with the node IDs
rec1 -> rec2 -> rec3 -> rec4
}",
height = 200)
But I noticed that the diagram's resolution is really bad. This is because it exports to a PNG image insteaad of a PDF. Most diagrams I do export to PDF so their quality is really good, but DiagrammeR exports to PNG for some reason. How can I make it export to PDF?