Chunk Options in R Markdown

To customize the chunk output with chunk options.

Thierry Warin (SKEMA Business School (Raleigh, NC))

By using SKEMA Quantum Studio framework (Warin 2019), this course will teach you how to use r chunk options.

Course objectives

You will discover multiple existing chunk options and use them to customize your chunk output.

Course plan

1. Code chunks

Familiarizing yourself with the concept of a chunk options.

2. The eval option

Not running the code of a chunk.

3. The include option

Running the code but hide the code and results.

4. The echo option

Preventing the code from appearing.

5. The fig.align option

Adjusting the alignment of a figure.

6. The fig.height option

Adjusting the height of a figure.

7. The fig.width option

Adjusting the width of a figure.

8. The include_graphics function

Taking care for the different output formats and provides some more features.

9. The option

Hiding printed output.

10. The error option

Continuing the render even if code returns an error.


Warin, Thierry. 2019. “SKEMA Quantum Studio: A Technological Framework for Data Science in Higher Education.”


For attribution, please cite this work as

Warin (2020, March 25). Virtual Campus: Chunk Options in R Markdown. Retrieved from

BibTeX citation

  author = {Warin, Thierry},
  title = {Virtual Campus: Chunk Options in R Markdown},
  url = {},
  year = {2020}