True single-file notebooks?


I’m wondering whether the RStudio team (or others?) have any plans to evolve the R Notebook format to a single-document notebook, or whether the current format is seen as pretty much the desired end state.

In the notebook formats I’ve worked effectively with previously (e.g. org-mode and Jupyter), the notebook that you interact with also contains whatever output is necessary to export to HTML or PDF or other formats. This includes images, tables, raw console output, etc. It doesn’t include the R session data that created it.

By contrast, R Notebooks seem to contain only the input data cells, and the output goes to an external HTML file. This means that if I close my notebook environment, I (sometimes?) lose all the output, and I have to re-run whatever R code created the output, which is sometimes onerous. It also means there doesn’t seem to be a mechanism for rendering the HTML (or other) document using an external driver like a Makefile, unless I want to re-run all the code again. I find that setup a lot more awkward than just storing the output in the same document, which I can stick in Git.

I know there’s an output caching mechanism available, but it doesn’t tend to match very well with my needs - usually I want to regenerate when the underlying data has changed, or some code in a package has changed, not when the (typically very short) code in the notebook has changed. It works much better for me to manually control re-running instead of letting a caching mechanism guess about it.

Is something like I’ve described in the offing? Or maybe a way to achieve it using a configuration I haven’t discovered yet?