Codefrag demo

Code annotations as fragments

Mickaël Canouil, Ph.D.

mickael.canouil.fr

2026-04-20

Step through an R pipeline

library(dplyr)
mtcars |>
  filter(cyl == 6) |>
  group_by(gear) |>
  summarise(mean_mpg = mean(mpg)) |>
  arrange(desc(mean_mpg))
1
Load the dplyr package.
2
Keep only six-cylinder cars.
3
Compute the mean mileage per gear.
4
Sort the resulting table.