Simulates typing of R script files for presentations and demonstrations. Provides character-by-character animation with optional live code execution. Supports R scripts (.R), R Markdown (.Rmd), and Quarto (.qmd) documents.

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).
# 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")
Here's an example of how to use the typeR package:
library(typeR)
# Create a test script for demonstration
writeLines(c(
"# Testing typeR",
"x <- 1:10",
"y <- x*2",
"plot(x, y)"
), "test_script.R")
# Simulate typing the script (display only)
typeR("test_script.R", delay = 0.05)
# Type AND execute the code
typeRun("test_script.R", delay = 0.05)
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.
typeRun() executes code in real-time as it types.R, .Rmd, and .qmd (Quarto) filesdelay and jitter for natural typing rhythmContributions are welcome! Please open an issue or submit a pull request.
This package is licensed under the MIT License. See the LICENSE file for details.