Setup

What to install before the sessions

You need R, Quarto, and an editor. If you already render Quarto documents from R, you are ready.

NoteSetup at a glance

Complete these four steps:

  1. Install R ≥ 4.5, Quarto ≥ 1.9, and an editor.
  2. Get the materials: one line of R, with no git or GitHub account needed.
  3. Install the R packages: one install.packages() line.
  4. Check it works: run the check script from the top folder.

Complete steps 2–4 before the workshop so we can start with Quarto.

Optional, for Day 2. The last step of Day 2 puts your site online with Posit Connect Cloud. If you want to try it, create a free account at https://connect.posit.cloud beforehand. Publishing is optional. The Day 2 project still builds a local _site/ folder without an account.

Slides and labs remain available at https://cderv.github.io/raukr-2026-quarto/.

Software

  • R ≥ 4.5.0. Check with R.version.string. The exercises use the penguins dataset included with R since 4.5. If you cannot upgrade, see the fallback below.
  • Quarto ≥ 1.9. Check with quarto --version and get it from https://quarto.org/docs/get-started/. (1.9 is required: the Typst margin/article layout we use on Day 1 landed in 1.9.)
  • An editor with Quarto support: Positron, VS Code with the Quarto extension, or RStudio.

RStudio can use a different Quarto from the one on your PATH. Day 1 requires Quarto ≥ 1.9.

The quarto R package has a one-line check for exactly this:

# install.packages("quarto")
quarto::quarto_binary_sitrep()

It names the binaries and returns TRUE when they agree. A mismatch looks like:

✔ quarto R package will use '/opt/quarto/bin/quarto'
✖ RStudio IDE render button seems configured to use '/usr/lib/rstudio/bin/quarto/bin/quarto'.

If the two disagree, point RStudio at the install you want with RSTUDIO_QUARTO, or render from the Terminal with quarto render <file>.

Tip

Typst (the PDF system used on Day 1) is bundled with Quarto. You do not need a separate Typst or LaTeX installation.

The exercises assume base R’s penguins. If you cannot use R ≥ 4.5, install palmerpenguins and rename its columns to the base-R names the material uses, so every snippet works unchanged:

# install.packages("palmerpenguins")
library(dplyr)
penguins <- palmerpenguins::penguins |>
  rename(
    bill_len    = bill_length_mm,
    bill_dep    = bill_depth_mm,
    flipper_len = flipper_length_mm,
    body_mass   = body_mass_g
  )

Run this before the exercise code.

Get the materials

Download the starter documents, solutions, and citation files with use_course(). You do not need git or a GitHub account.

Choose where the materials go: set your R working directory to that folder, then run:

# install.packages("usethis")   # once, if you don't have it
usethis::use_course("cderv/raukr-2026-quarto-exercises", destdir = ".")

use_course() unpacks a versioned folder and opens it in RStudio or Positron. From a plain R console, it sets your working directory to that folder instead. Its name includes a suffix that changes with each update (for example cderv-raukr-2026-quarto-exercises-d11a9fb/). This is the top folder used below. Keep the downloaded ZIP when prompted: you can use it to reset the exercises.

ImportantIn the session, open the day folder

When a session starts, work from that day’s folder inside the download:

  • Day 1day1-intro/
  • Day 2day2-projects/

Do not open the top folder as your workspace.

How you get there depends on your editor:

  • Positron or VS Code: select File ▸ Open Folder…, then pick the day folder.
  • RStudio: double-click the .Rproj file inside it (day1-intro.Rproj, day2-projects.Rproj).

Either route opens the day folder as your workspace. Quarto then resolves the files next to your document (_brand.yml, references.bib) and writes rendered output there.

One download covers both days. Reference answers are in solutions/day1/ and solutions/day2/.

To reset a day, create a new copy rather than overwriting your work. Choose one:

  • re-run the use_course() line above (each download unpacks into its own versioned folder, so nothing is overwritten).
  • unzip the ZIP you kept to a new location.

If use_course() can’t reach GitHub (blocked network / firewall), use the browser: the green Code ▸ Download ZIP button on https://github.com/cderv/raukr-2026-quarto-exercises, then unzip.

R packages

Install the nine packages used in the exercises:

install.packages(c(
  "dplyr", "ggplot2", "gt", "ggokabeito",   # content + a color-blind-safe scale
  "brand.yml", "ggrepel", "prismatic",      # R-side branding for the final Typst PDF
  "knitr", "rmarkdown"                      # the engine every .qmd with R code needs
))

Alternatively, use pak:

# install.packages("pak")   # once, if you don't have it
pak::pak(c(
  "dplyr", "ggplot2", "gt", "ggokabeito",
  "brand.yml", "ggrepel", "prismatic",
  "knitr", "rmarkdown"
))

Check your setup

From the top folder of the download (the one use_course() opened), run:

source("00-check-setup.R", local = new.env())

(local = new.env() keeps the script’s helper objects out of your workspace.)

It checks R, Quarto, the packages, and the data. It also renders the Day-1 Typst sample (the resulting sample-typst.pdf is written in day1-intro/) and downloads the fonts used in the workshop. Every check should read [ok].

Run quarto check and look for Checking Knitr engine render......OK. If you see rmarkdown: (None), install the R packages and run the check again. Then confirm R:

R.version.string                          # want >= 4.5.0
"penguins" %in% ls("package:datasets")    # want TRUE on R >= 4.5

Download the fonts by rendering the sample once: quarto render day1-intro/sample-typst.qmd.