TLDR: library(consort) is a great package for creating CONSORT/patient flow diagrams in R. Thank you author Alim Dayim!
Jump to example code.
Documentation.
Introduction The easiest way to make a one-off diagram is using something with a graphical interface, such as Power Point, Omnigraffle, or Lucidchart, just to name a few.
If, however, you need something that updates automatically based on the underlying dataset changing, then a programmatical solution using R is possible.
What is Quarto? Prerequisites 1. Create a new Quarto website project Troubleshooting 2. Edit your Quarto website 3. Add a page to your website 4. Add R code to your website 5. Serve your website using Netlify Optional: If want to keep the site for longer than 1h 6. Update your website Optional advanced: automatic deploys via GitHub I’ve put together a quick ‘getting started with Quarto and Netlify and GitHub (optional) workshop’.