From the course: Creating Reports and Presentations with R Markdown and RStudio

What is R Markdown? - RStudio Tutorial

From the course: Creating Reports and Presentations with R Markdown and RStudio

Start my 1-month free trial

What is R Markdown?

- [Instructor] To properly wrap our head around what R Markdown is, it's best to think of it as thee things simultaneously. R Markdown is an R package available from CRAN that you need to install to use. And you install it in the same way as you install any R package, with the function install.packages. The R Markdown package is developed by the folks at RStudio. Therefore, the RStudio application is designed as the document editor for R Markdown. R Markdown files have the extension .Rmd. It's not impossible to use R Markdown without RStudio, but RStudio makes it a real delight to use. And thirdly, the R Markdown package is a collection of many different tools that work together to convert your R Markdown files, that's the files with the .Rmd extension, into HTML, PDF, Microsoft Word documents, and many other file types. There are therefore two components of R Markdown: .Rmd file, which contains all of our content, and the R Markdown package that passes the .Rmd file and generates to specify output files. .Rmd files are plain text files that contain all of the information necessary for RStudio to generate our output files using the R Markdown and knitR package. For reference purposes, this is a screenshot of the built in RStudio template .Rmd file. There are three distinct parts to the document, and in fact, each is written in a different language. The file header tells the R Markdown package what type of file to create. In this case, an HTML document. And it's worth noting that this header is written in YAML. The text in the document is written in Pandoc flavored Markdown. Any R code that we want to include or evaluate in a document is contained within code chunks. These are delimited by pairs of three back ticks. Note that these back ticks are actually part of the Pandoc Markdown syntax. This is the beauty of R Markdown. It allows us to combine text, images, code, and output together into a huge variety of different output formats to create rich reports and presentations.

Contents