manimR brings the power of mathematical animation to R, making it as easy to create stunning visualizations as it is to create plots with ggplot2. Inspired by Grant Sanderson’s manim (the engine behind 3Blue1Brown), manimR provides a tidyverse-friendly API for R users.
Why manimR?
Tidyverse-friendly: Works seamlessly with pipes and tidy data
Intuitive: Grammar of graphics meets grammar of motion
Powerful: From simple animations to complex 3D visualizations
Accessible: Visual scene builder included
Fast: Optimized rendering with caching and parallel processing
Installation
# Install from CRAN (when available)
install.packages("manimR")
# Or install the development version from GitHub
# install.packages("pak")
pak::pak("Reyanda/manimR")Quick Start
library(manimR)
scene("pythagorean_theorem") %>%
add_latex("a^2 + b^2 = c^2") %>%
write_in(duration = 2) %>%
pause(1) %>%
highlight_term("c^2", color = "yellow") %>%
render()
Features
ggplot2 Integration
Convert existing ggplot2 visualizations to animations:
library(ggplot2)
p <- ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
geom_smooth()
convert_ggplot_to_manim(p) %>%
render()Pre-built Templates
Use templates for common animation patterns:
use_template("theorem_proof") %>%
set_theorem("Pythagorean Theorem", "a^2 + b^2 = c^2") %>%
set_proof_steps(list(
"Consider a right triangle...",
"By similar triangles..."
)) %>%
customize(color_scheme = "academic") %>%
render()Example Gallery
Visit our example gallery to see manimR in action.
Requirements
- R >= 4.1.0
- Optional: LaTeX for mathematical notation (install TinyTeX)
- Optional: ffmpeg for video export
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Code of Conduct
Please note that manimR is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Acknowledgments
- Inspired by Grant Sanderson’s manim
- Built with love for the R community
- Thanks to all contributors
