09 RMarkdown

Part 9: introducing RMarkdown reports

Template

In this Section I recommend that you open a template RMarkdown by going to File/New File/R Markdown…. The wizard will prompt for a Title that can be something like Test, then select OK.

Knit the file by selecting the wool and needle button just under the tab names, next to the magnifying icon. RStudio also has some great lessons here.

Slightly more complex example

I then show the following report that I’ve built to show more of the text possibilities in R Markdown.

GitHub code for RMarkdown report

https://intro-r-slides.netlify.app/10-intro-rmarkdown.html

A much more fancy and fantastic example from Simon Wellesley-Miller

I can never resist showing this final example, which Simon has talked through at the NHS-R Community Conference:

Video from the 2020 NHS-R Conference

There are tons of examples of what you can put in an R Markdown from interactive, searchable tables to maps, it’s a great catalogue of possibilities and worth reading too as Simon has made the report itself an enjoyable read.

Simon’s repository

https://swm-markdown.netlify.app/r-training-v5

GitHub access

Some organisations have very secure VPNs that block GitHub where these resources are hosted. If you attend the workshop you will have the files pre-loaded into the RStudio/Posit Cloud work space.

If you want to get the code for Simon Welleley-Miller’s RMarkdown the button in the top right of the webpage Code will output the RMarkdown file which you can then save.

Featured art: https://thegraphicsfairy.com/steampunk-clip-art-hot-air-balloons/