Setup

1 Introduction

1.1 Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.

1.2 Running Code

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

1 + 1
[1] 2

You can add options to executable code like this

[1] 4

The echo: false option disables the printing of code (only output is displayed).

1.3 Reproducible Reports with Quarto and R Markdown

Reproducibility isn’t just important for scientific publishing or collaborating with others; it’s also essential for your most important collaborator: your future self! If you’re an R or Python user, learning Quarto will dramatically improve the quality and interpretability of your work.

Quarto, the successor to the popular R Markdown system, is designed to combine narrative, code, tables, figures, and citations into a single dynamic document. This allows you to focus simultaneously on the analysis and its interpretation. Equally important, anyone with a computer can reproduce youresults if given access to your Quarto file and data sets.

Quarto includes powerful new features, including the ability to use different coding languages including R, Python, and Julia. It’s also surprisingly easy to learn and use. This seminar will introduce you to the Quarto system. After learning the basic syntax, you’ll quickly learn how to make fantastic-looking final products.

After completing this course, here are some things you’ll be able to do: 

  • Create code chunks to insert executable code in your document.

  • Integrate tables, figures, and citations into a document.

  • Produce a professional-looking report or paper.

  • Apply the Quarto approach to other formats such as presentations, posters, and web content.

  • Use reproducible reports to simplify your workflow and improve your data analysis practices.

This seminar will use R for the examples and exercises, but it will benefit Python users as well. If you have a project that you would like to develop using Quarto, you are welcome to bring that to class with you.