Quarto Rendering
ir render renders Quarto documents and Quarto-formatted R scripts with quarto render. Runtime metadata lives under an ir: key in the source YAML.
---
title: My report
ir:
packages:
- dplyr>=1.0
- gt@1.0
r-version: ">= 4.0"
isolated: true
exclude-newer: 2024-01-15
---Render the document with the render subcommand:
$ ir render report.qmd
$ ir render report.qmd --to pdf
$ ir render --exclude-newer 2024-01-15 report.qmd
$ ir render --vanilla report.qmd
Quarto R scripts use Quarto’s knitr script header syntax:
#' ---
#' title: "My report"
#' ir:
#' packages:
#' - dplyr>=1.0
#' ---$ ir render report.R
The ir.packages value follows the same rules as script packages: use a YAML sequence where each entry is one package ref, or omit it, set it to [], or set it to null for no dependencies.
ir resolves the document packages into the same cached library model used for scripts, then launches quarto render. Arguments after the source path are passed to quarto render.
Use --vanilla before the source path to pass --vanilla to the Rscript used by Quarto. Snapshot date precedence is --exclude-newer, then IR_EXCLUDE_NEWER, then frontmatter ir.exclude-newer. An empty --exclude-newer or IR_EXCLUDE_NEWER overrides frontmatter ir.exclude-newer and resolves latest packages. Future snapshot dates also resolve latest packages.
When ir selects an R executable by --rscript, IR_RSCRIPT, --r-version, IR_R_VERSION, frontmatter ir.r-version, or date-only exclude-newer, it sets QUARTO_R so Quarto renders with that R. Frontmatter ir.rscript is rejected.
Set IR_QUARTO to use a specific Quarto executable.
Python environments
Use ir.python-packages to ask ir render for a Python environment before launching Quarto. ir resolves the environment with reticulate:::uv_get_or_create_env() and injects jupyter. It passes the resulting Python executable to Quarto with QUARTO_PYTHON and to reticulate with RETICULATE_PYTHON. Python environment resolution uses ir’s private reticulate tooling. Declare render-time R dependencies with ir.packages and Python dependencies with ir.python-packages. When Python metadata is present, ir.exclude-newer is also used during Python environment resolution unless ir.python-exclude-newer is set. Set ir.python-exclude-newer to null or "" to use latest Python packages while keeping ir.exclude-newer for R.
---
title: Python report
jupyter: python3
ir:
python-packages:
- pandas
- matplotlib
python-version: "3.11"
exclude-newer: 2026-06-01
python-exclude-newer: 2026-05-01
---R package injection
A Quarto render needs the rmarkdown package for the knitr engine. ir appends rmarkdown to the resolved packages automatically when it is not already present, pulling the latest version (or the latest as of exclude-newer when set).
Declare rmarkdown yourself under ir.packages - directly (for example, rmarkdown@2.29) or transitively through a package that imports it - to override the injected seed.
Knitr-backed Quarto documents with Python chunks can use reticulate for Python execution. ir detects local Python chunks in .Rmd files and in .qmd files that select knitr or contain both R and Python chunks, then appends reticulate when the resolved package set does not already provide it.
For Jupyter renders, declare ir.python-packages or ir.python-version when ir render should create the Python environment and inject jupyter.