Skip to content
R for the Rest of Us Logo

R in 3 Months (Fall 2025)

Week 12 Live Session (Fall 2025)

View code shown in video

Here is my report.qmd file shown today:

---
title: "Penguins Report"
format: html
execute: 
  echo: false
  warning: false
  message: false
params:
  island: "David"
---

```{r}
library(tidyverse)
library(palmerpenguins)

data(penguins)
```

This is a report about penguins on `r params$island` island.

```{r}
penguins_filtered <-
  penguins |>
  filter(island == params$island) |>
  group_by(sex) |>
  summarize(avg_bill_length = mean(bill_length_mm, na.rm = TRUE)) |>
  ungroup() |>
  drop_na(sex)
```

```{r}
library(assertr)

penguins_filtered %>%
  verify(nrow(.) >= 1)
```


```{r}
penguins_filtered |>
  ggplot(aes(x = sex, y = avg_bill_length)) +
  geom_col() +
  labs(title = str_glue("Average bill length by sex"))
```

And here is the render.R file:

library(tidyverse)
library(palmerpenguins)
library(quarto)

data(penguins)

islands <-
  penguins |>
  distinct(island) |>
  mutate(island = as.character(island)) |>
  mutate(island = str_glue("{island} island")) |>
  pull(island)

quarto_render(
  input = "report.qmd",
  output_file = "biscoe-report.html",
  execute_params = list(island = "Biscoe")
)

# reports <-
#   tibble(
#     input = "report.qmd",
#     output_file = "biscoe-report.html",
#     execute_params = list(list(island = "Biscoe"))
#   )

reports <-
  tibble(
    input = "report.qmd",
    output_file = str_glue("{islands}.html"),
    execute_params = map(islands, ~ list(island = .))
  )

pwalk(reports, quarto_render)

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Course Content

128 Lessons