WCHD Workshop – Quarto

Quarto

Quarto (the next generation of RMarkdown) enables you to weave together content and code into a finished product.

Image Source: Epi R Handbook

Quarto

If you’re familiar with Rmarkdown, you know how to use Quarto! (And if not, no worries, you’re about to learn)

What is Quarto good for?

  • Making automated reports or presentations - html, pdf, Word, Powerpoint formats
  • Making code, code snippets, etc. sharable and reproducible
  • Quick analyses that are documented and reproducible (and can include interactive graphs for example)
  • Make interactives, dashboards, websites, etc. (for internal or external purposes)

Quarto files

Quarto files have an ending of .qmd and are “rendered” into a document type of your choice.

  • Html (i.e. websites like the one for this workshop!) - this is probably the most flexible format! You can use html for many things, e.g. interactive dashboards, reports, code snippets, etc.
  • Web slides (like this!)
  • Powerpoint
  • Word
  • Pdf
  • And more! (latex, epub, wiki—complete list here)

Parts of the Document

  • The YAML Header: sets “global options” for the document
    • Different information for html or pdf output
  • Code Chunks: generate content for the document (figures, tables, etc.) or show examples of code
  • Text: formatted using Markdown

Learning by Doing

  • General Practice and Exploration
  • Specific Recreation

Let’s start by building from scratch!

Most of these examples are also in general_quarto.qmd (so you can reference that file later if you want to see how something should look)

install.packages("rmarkdown")

Make a new file and select “Quarto Document”