O'Reilly logo

Mastering RStudio – Develop, Communicate, and Collaborate with R by Maximilian H. Nierhoff, Julian Hillebrand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Advanced R Markdown documents

After compiling our first R Markdown report, we want to go ahead and look at the advanced options for embedding code chunks with the knitr syntax. Also, you will learn how to brand your reports with custom style sheets.

Getting to know R code chunks

As we have already seen in our sample report, R Markdown uses so called code chunks to render R Code into reports.

Getting to know R code chunks

This exemplary code chunk shows the most elementary way to include an R code snippet in our .Rmd file. Just three back ticks, ``` at the beginning and end of the chunk, and the letter r in curly brackets, {r}.

Even if it is a short code chunk, the output includes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required