Event Information

Course content and pre-requisites

Who should attend / target audience

Data Analysts and anyone interested in learning about RMarkdown.

The course is informal and is intended to help you feel comfortable with asking questions in the workshop and beyond the course through the NHS-R Community.

Pre-requisites:

Some prior knowledge of R is required and has either attended the NHS-R Community Introduction to R and R Studio course or have used some R (but by no means an “expert”).

You are expected to have completed the prework and set up an account with RStudio Connect.

If you are wanting to use your own computer/RStudio the instructions in this prework will equally work for installing the packages required and the files for the course.

What delegates will gain/ learning outcomes

Why RMarkdown:

RMarkdown is a powerful way of coding manuscripts, reports and managing workflows in R. It can combine many programming languages, along with text and can be extended to build a range of things, including websites like this!

RMarkdown can be used to produce documents of any type, from pdfs and presentation slides to (accessible!) html files supporting interactivity and, behind the scenes, mixing up code with text in a seamless way that feels almost magical. RMarkdown is a natural extension to analysis coding in R and many institutions that teach R use RMarkdown from the first day due to its flexibility for work flow.

Learning Outcomes:

After this one-day introduction, delegates will:

  1. Understand more about how RMarkdown works.
  2. Learn about the ways of getting the most out of RMarkdown using the RStudio IDE.
  3. Learn how to use Command Line to “code” even more functionality that RMarkdown offers.

Delegates will:

  1. Learn about the markdown part of markdown in how to format Text.
  2. Will be introduced to how to include images into RMarkdown.
  3. Learn more about RMarkdown’s code chunks and explore what their settings do.
  4. How to mix up code in your text in order to automate analysis.
  5. Learn more about setting out reports using tabs and how to automate these for very long reports.
  6. Explore the output formats that are possible with RMarkdown.
  7. Learn about parameters which are used to produce multiple reports that have distinct values for certain categories, for example departments or geographical regions.
  8. Be introduced to the power of the Command line coding in relation to RMarkdown which is a step away from using the click once (Graphical User Interface) functionality offered by RStudio.
  9. Be briefly introduced to loops in relation to using parameters.
  10. Learn about taking existing R scripts and making them RMarkdown (without copying and pasting) and back again.
  11. Learn about incorporating SQL code into RMarkdown.

Programme Outline (including objectives)

Timings in the course vary but there are specifically placed break slides in the course.

This will be a recorded session so you will have an opportunity to catch up or go over information again at a later date.

  • Getting set up How to prepare ahead of time
  • What’s inside? A breakdown of the parts that make up RMarkdown

——— 10 minutes Break ———

  • Text Explaining how to change the text formats of Markdown
  • Images Linking to images in RMarkdown
  • Code chunks Understanding the metadata of code chunks

——— 1 hour Lunch ———–

  • Inline code Using code within text
  • Tabs Adding and formatting tabs

——— Break ———

  • Output Formats Exploring the in-build and external package output formats
  • Parameters Using Parameters to change reports
  • Command Line Using RMarkdown from the command line

——— 10 minutes Break ———

  • Loop reports Using loops and purrr to generate multiple reports from parameters
  • Extras Spinning, purling, sourcing and using SQL