typeR is an R package that simulates typing effects on R script files, making it ideal for live coding presentations, interactive teaching, or creating animations. It supports R scripts, R Markdown, and Quarto presentations (including reveal.js slides).
Installation
# Install from CRAN
install.packages("typeR")
# Or get development version
# Install devtools if you don't already have it
install.packages("devtools")
devtools::install_github("Fgazzelloni/typeR")Usage
Quarto Presentations
Perfect for live coding in presentations! Works seamlessly with Quarto reveal.js slides:
# Use the included example presentation
demo_file <- system.file("examples/demo-presentation.qmd", package = "typeR")
typeRun(demo_file)
# Or create your own Quarto presentation
typeRun("my-presentation.qmd", delay = 0.08, max_print = 5)See the Quarto Presentations vignette for detailed examples and best practices.
Features
- Typing Animation: Simulates realistic typing of R code character by character
-
Live Execution:
typeRun()executes code in real-time as it types -
Multiple Formats: Supports
.R,.Rmd, and.qmd(Quarto) files - Quarto Presentations: Perfect for reveal.js slides and other Quarto formats
- Interactive Control: Press ESC to pause, then resume or stop
- Smart Output: Handles plots, models, and long outputs intelligently
-
Customizable Speed: Adjust
delayandjitterfor natural typing rhythm - Teaching-Friendly: Ideal for courses, workshops, and conference presentations
License
This package is licensed under the MIT License. See the LICENSE file for details.
