Welcome to the typeR package!
In this vignette, you’ll learn how to install the package, what it’s designed for, and how to use its core functionality. Whether you’re a beginner or an advanced R user, this guide will help you get started on the right foot.
This package is designed to simulate typing effects in R scripts for presentations and tutorials.
If you haven’t already, you can install the package. As soon as it becomes available on CRAN:
Install the development version on GitHub:
# Install devtools package if not already installed
if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}
# Install from GitHub
devtools::install_github("fgazzelloni/typeR")After installation, load the package:
Let’s dive into a simple example to show you how typeR works in practice.
The typeR() function can simulate typing an R script
line by line in the R console. Here’s a basic example:
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
typeR("test_script.R", delay = 0.05)And here’s what the output looks like:
For live code execution with typing animation, see the dedicated vignette:
This vignette covers how to use the typeRun() function,
which types out and executes R code in real-time.
Check out the function reference documentation for details on the available parameters and their usage.
Now that you’re up and running with typeR, here are a few suggestions for further learning:
?typeRThanks for using the typeR package! Feedback and contributions are always welcome. If you encounter any issues or have suggestions, feel free to reach out on https://github.com/Fgazzelloni/typeR.
Happy coding!