Session 3
Saturday, the 7th of February, 2026
This session explores Quarto’s computational capabilities, focusing on seamless multi-language workflows, code cell options, and integration patterns for R and Python data science stacks.
By the end of this session, participants will be able to:
|) syntax.Configure engines in your document header:
knitr jupyter julia Tip
Set explicitly the engine in your document header instead of relying on auto-detection which does not work for inline code (i.e., `{language} ...`).
A code cell (also called a code chunk) is a section of executable code (defined by ```{language}) embedded within your Quarto document.
Code cells allow you to:
qmd
python, r, julia).
label, echo, eval).
execute options
| Option | Description |
|---|---|
eval |
Evaluate the code chunk (if false, just echos the code into the output). |
echo |
Include the source code in output |
output |
Include the results of executing the code in the output (true, false, or asis to indicate that the output is raw markdown and should not have any of Quarto’s standard enclosing markdown). |
warning |
Include warnings in the output. |
error |
Include errors in the output (note that this implies that errors executing code will not halt processing of the document). |
include |
Catch all for preventing any output (code or results) from being included (e.g., include: false suppresses all output from the code block). |
renderings |
Specify rendering names for the plot or table outputs of the cell, e.g., [light, dark]. See Renderings. |
The “comment symbol” + “pipe” (|) syntax allows to pass options to code cells.
Output Control:
Store expensive computation results to avoid re-running during development.
Two Types:
Prevent documents from re-executing during project renders.
Results saved in _freeze directory (commit to version control).
| Action | Cache | Freeze |
|---|---|---|
| Individual document render | ✅ Used | ❌ Ignored |
| Project render | ✅ Used | ✅ Controls execution |
| Prose changes | No effect | No effect |
| Code changes | Invalidates cache | Triggers re-render (auto mode) |
_freeze directory contents.Parameters allow you to create dynamic variations of the same document:
Tip
Think of parameters as variables that make your documents code reusable and flexible.
#| tags: [parameters] comment..qmd and .ipynb files.Use the -P (--execute-param) flag to override parameter values:
Create reusable parameter sets with YAML files:
Benefits
Version control, team sharing, complex configurations.
x, val).Perfect for
CI/CD pipelines, batch processing, scheduled reports.
Objective: Transform your Session 2 portfolio document into a computational showcase by adding live code execution, demonstrating the power of embedding computations in Quarto documents using modern Python tools.
Example Code:
Choose your language and update your YAML header:
yaml
Install packages:
yaml
Install packages:
Replace your skills table from Session 2:
DataFrame with your skills data.print() to display the data nicely.pl.sum().`{python} your_calculation`.data.frame with your skills data.knitr::kable() to display the table nicely.sum().`{r} your_calculation`.DataFrame with your skills data.DataFrame directly.sum().`{julia} your_calculation`.Make a chart of your skills:
geom_col() or geom_bar().labs().theme_minimal() for clean styling.#| fig-cap:.geom_col() or geom_bar().labs().theme_minimal() for clean styling.#| fig-cap:.bar() function.xlabel!() and ylabel!().title!().#| fig-cap:.Try different code cell options:
#| eval: false (shows code, doesn’t run).#| code-fold: true.#| echo: false but show output.#| include: false for data setup.#| eval: false (shows code, doesn’t run).#| code-fold: true.#| echo: false but show output.#| include: false for library loading.#| eval: false (shows code, doesn’t run).#| code-fold: true.#| echo: false but show output.#| include: false for package imports.✅ You’ve successfully completed the exercise if you can: