Reproducible Research

Quarto

Weekly design


Pre-class video


Get started with Quarto in R



Class


We use this material for the class

https://r4ds.hadley.nz/quarto


Quarto?

Quarto provides a unified authoring framework for data science, combining your code, its results, and your prose. Quarto documents are fully reproducible and support dozens of output formats, like PDFs, Word files, presentations, and more.

Quarto basics

This is a Quarto file – a plain text file that has the extension .qmd:

It contains three important types of content:

  1. An (optional) YAML header surrounded by ---s.
  2. Chunks of R code surrounded by ```.
  3. Text mixed with simple text formatting like # heading and _italics_.

Diagram of Quarto workflow from qmd, to knitr, to md, to pandoc, to output in PDF, MS Word, or HTML formats.


Source Editor

Code Chunks


Figures and Tables

knitr::kable(mtcars[1:5, ], )
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2


Caching

YAML Ain’t Markup Language


You can create … using quarto.

  • a website

  • a presentation

  • a pdf document


For a website:

For a presentation:

Let’s explore more galleries using quarto