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

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The YAML header of an .Rmd file

The YAML header of an .Rmd file - RStudio Tutorial

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

Start my 1-month free trial

The YAML header of an .Rmd file

- There are many different components to an RMarkdown document. Let's take a detailed look at the YAML header, which I've marked here as lines one through four. The YAML header is at the very top of the document. It needs to be the very first thing in the .rmd file. The header is delimited by three dashes at both the beginning, and end. Everything between these dashes is written in YAML. So what's YAML? YAML is an extremely popular language choice for configuration files. And that's kind of how we use it in our markdown. YAML is very simple. It's a set of key value pairs with colons separating the option name, and option value for your RMarkdown document. It's not really necessary to learn YAML. It's a thing that we use to set knitting options in RMarkdown documents. However, it's extremely useful to know the header is written in YAML, as it makes it much easier to google exactly how do I modify X in my document. Okay, now let's cover more explicitly how YAML is used in the .rmd file.…

Contents