Have a Quarto (.qmd) or R Markdown (.Rmd) data analysis you want to turn into an interactive tutorial with built-in solutions? This package is what you need.
tutorizeR converts existing R Markdown (.Rmd) or Quarto (.qmd) files into interactive tutorials powered by learnr. Each code chunk becomes an exercise block followed by a solution chunk ready to be graded with gradethis.
- Input Support: Accepts both
.Rmdand.qmdinput files. - Output Formats: Generates standard
learnrtutorials ORquarto-live(WebAssembly) tutorials. - Pedagogical Control:
- Skip specific chunks with
# tutorizeR: skip. - Choose assessment type:
assessment = "code","mcq", or"both".
- Skip specific chunks with
- Usability:
- Batch convert folders with
convert_folder(). - RStudio Addin for one-click conversion.
- Batch convert folders with
- Robustness:
- Preserves
setupchunks. - Strips YAML front matter.
- Verifies rendering (for learnr tutorials).
- Preserves
Install the development version from GitHub with:
# install.packages("remotes") # if not already installed
remotes::install_github("AurelienNicosiaULaval/tutorizeR")library(tutorizeR)
# Convert a Quarto or R Markdown document to a learnr tutorial
convert_to_tutorial("analysis.qmd", assessment = "both")
# Convert to Quarto Live (WebAssembly)
convert_to_tutorial("analysis.qmd", format = "quarto-live")
# Batch convert a folder
convert_folder("labs/")This will create analysis-tutorial.Rmd (or analysis-live.qmd) containing interactive exercises.
