I recently went to an interesting EdinbR talk on RMarkdown and the workflow available via R Studio and its products. I’d not used any markdown before but had seen its use in documentation, and this was the little nudge I needed to explore its use myself.
The thing is, it’s great for documenting your R code as you go (explaining the ‘code flow’), but as soon as I started thinking about how I wanted to use it, I realised I wanted the final output (aka documentation) to be more of a tutorial showing how something is done. And importantly, tutorials don’t always follow the code flow, but flit in and out of it to explain things in a logical order for the tutorial – often starting with the output you’ll achieve by the end (much like a recipe showing a photo of the finished cake at the start).
Re-jigging the order
In order to make th
