Reflections on the 12 Years of R Markdown from a Developer’s Perspective

Yihui Xie

2024-05-31

1 What’s R Markdown?

A 10-second introduction:

Write _narratives_ in Markdown, and _computer code_ in backticks:

```{r}
mean(rnorm(100))
```

Write **more** code chunks and narratives.

The idea come from Knuth’s Literate Programming.


2 How it started


3 Did Markdown’s simplicity work?

Appears so.


4 R Markdown in 2012 vs 2024

2012 2024
Output formats HTML HTML, LaTeX, PDF, Word, PowerPoint, EPUB, …
Applications Reports Reports, slides, articles, books, websites, dashboards, …
Backend sundown (a tiny C library) Pandoc
R package dependencies 0 25
Package size ~2Mb ~83Mb (Pandoc: 152Mb)

The above comparison does not include R Markdown extension packages such as bookdown and blogdown, which are even heavier.


5 What makes reproducibility hard?


5.1 Features


We all hate breakage

The ActivePapers case

[…] While it has achieved its mission of demonstrating that unifying computational reproducibility and provenance tracking is doable and useful, it has also demonstrated that Python is not a suitable platform to build on for reproducible research. Breaking changes at all layers of the software stack are too frequent. The ActivePapers framework itself (this project) uses an API that was removed in Python 3.9, and while it can be updated with reasonable effort, there is little point in doing so: Published ActivePapers cannot be expected to work with a current Python stack for more than a year.

[…] If you came here to learn about reproducible research practices, the best advice I can give is not to use Python.


5.2 Dependencies

Some examples in my software development career:


5.3 Hey, I know how to fix the dependency hell

Yes, users could adopt tools like renv, virtualenv, or even Docker to manage dependencies, but that could bring another problem:


5.4 In praise of CRAN


6 Minimalism: my new journey



⚡ litedown ⚡

Make Markdown HTML Again

Do one thing, and do it well


Thank you!

  1. RIP, Fritz Leisch!