2.7 Literate programming with R Markdown

  1. View the following short video:

Why use R Markdown for Lab Reports?

The preceding video described what can be referred to as literate programming: authoring a single document that integrates data analysis (executable code) with textual documentation, linking data, code, and text. In R Markdown, the executable R code is placed in “chunks”, and these are embedded throughout sections of regular text.

For an example of a PDF document that illustrates literate programming, see here. It accompanied a lab-based experiment examining the potential for freshwater diatoms to be successfully dispersed over long distances adhered to duck feathers.

  1. View the following youtube video on creating an R Markdown document.

If you’d like additional introductory tutorials on R Markdown, see this one from RStudio, or this one.