Creating Parameterised Reports Using Quarto

Bristol R User Group

16 July 2025

Saranjeet Kaur Bhogal

Imperial College London

Parameterised reports

What?

Single template report -> render multiple outputs

Automate using params

Why?

Accurate, Reproducible, Automated

No repetitive copy-paste, less prone to error

Example use cases

  • Periodic (e.g. weekly, monthly) analytics
  • Regional (e.g. country, state) reports
  • Scientific reports for different species (e.g. plants, flowers)

Flower dataset

species,size,fragrance,height_cm
rose, medium, mild, 48.55
shoeblack plant, medium, mild, 147.07
shoeblack plant, medium, none, 102.93
hibiscus, large, none, 184.0

Metadata

species: Type of flower (hibiscus, rose, or shoeblack plant)

size: Size category (small, medium, or large)

fragrance: Intensity of the fragrance (strong, mild, or none)

height_cm: Height of flower in centimeters (rounded to 2 decimal places)

Objective

For each species of the flowers, create a report giving a details about their summary and height distribution.

A .qmd file

Without params

---
title: "Flower Species Report: rose"
format: html
---

## Load dataset

```r
library(tidyverse)
df <- read_csv("data/flower_dataset.csv")
```

## Filter for species: rose
```
df_rose <- df %>% filter(species == "rose")
```

## Height distribution for rose

```r
ggplot(df_rose, aes(height_cm)) +
  geom_histogram()
```

With params

---
title: "Flower Species Report: `r params$sp`"
format: html
params:
    sp: "rose"
---

## Load dataset

```r
library(tidyverse)
df <- read_csv("data/flower_dataset.csv")
```

## Filter for species: `r params$sp`
```
df_filtered <- df %>% filter(species == params$sp)
```

## Height distribution for `r params$sp`

```r
ggplot(df_filtered, aes(height_cm)) +
  geom_histogram()
```

Render reports

library(quarto)
library(tidyverse)

# Species names
species <- c("rose", "shoeblack plant", "hibiscus")

# Create a tibble
reports <- tibble(
  input = "flower-report.qmd",
  output_file = stringr::str_glue("{species}.html"),
  execute_params = purrr::map(species, ~list(sp = .))
)

# Render each report
purrr::pwalk(reports, quarto_render)

Let’s run some code!

Bonus!

Branding with _brand.yml

_brand.yml?

A simple, portable YAML file that codifies brand guidelines (customised) into a format that can be used by Quarto to create branded outputs (for our purpose, reports)

_brand.yml

meta:
  name: Example organisation
  link: https://posit-dev.github.io/brand-yml

logo: logos/logo.png

color:
  palette:
    black: "#1A1A1A"
    white: "#F9F9F9"
    orange: "#FF6F20"
    pink: "#FF3D7F"
  foreground: black
  background: white
  primary: orange

typography:
  fonts:
    - family: Open Sans
      source: google

Branding resources

Let’s experiment!

Advantages of branding

  • Consistent branding across outputs
  • Shared consistency within teams
  • Minimal effort

Resources

Blog: Automating Quarto reports with parameters

Video: A step-by-step guide to parameterized reporting in R using Quarto

Video: Company-branded reports, apps, and dashboards made easier with brand.yml & Posit

Brand.yml Website: https://posit-dev.github.io/brand-yml/

Slides

Slides made using quarto and Wildflower theme

Thank you!

Talk link: https://saranjeetkaur.github.io/flower-report/

Talk repository: https://github.com/SaranjeetKaur/flower-report

GitHub: SaranjeetKaur

Email: kaur.saranjeet3@gmail.com