Intro to R Markdown Documents

Introduction to RMarkdown

Kennedy Waweru

2/9/2022

 


Tutorial Aims:

  1. Understand what RMarkdown is and why you should use it
  2. Learn how to construct a RMarkdown file
  3. Export an RMarkdown file into many file formats

 

 

1. What is R Markdown?

R Makdown allows you to create documents that serve as a neat record of your analysis. In the world of reproducible research, we want other researchers to easily understand what we did in our analysis, otherwise nobody can be certain that you analysed your data properly. You might choose to create an RMarkdown document as an appendix to a paper or project assignment that you are doing, upload it to an online repository such as Github, or simply to keep as a personal record so you can quickly look back at your code and see what you did. RMarkdown presents your code alongside its output (graphs, tables, etc.) with conventional text to explain it, a bit like a notebook.

R markdown makes use of Markdown syntax. Markdown is a very simple ‘markup’ language which provides methods for creating documents with headers, images, links etc. from plain text files, while keeping the original plain text file easy to read. You can convert Markdown documents to many other file types like .html or .pdf to display the headers, images etc.

When you use an RMarkdown file (.Rmd), you can use conventional Markdown syntax alongside chunks of code written in R (or other programming languages!). When you knit the RMarkdown file, the Markdown formating and the R code are evaluated, and an ouput file (HTML, PDF, etc) is produced.

Why Use R Markdown

Last updated 2022-02-20 12:32:34 by Kennedy Waweru