Skip to contents

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

Mathematical Notation

Create beautiful mathematical animations with full LaTeX support:

scene("calculus") %>%
  add_latex("\\int_0^1 x^2 dx") %>%
  write_in() %>%
  pause(1) %>%
  transform_to("\\frac{x^3}{3} \\Big|_0^1", duration = 2) %>%
  pause(0.5) %>%
  transform_to("\\frac{1}{3}", duration = 1) %>%
  render()

Data-Driven Animations

Animate your data directly from tibbles:

library(dplyr)

mtcars %>%
  animate_scatter(
    x = mpg,
    y = wt,
    color = cyl,
    duration = 3
  ) %>%
  render()

ggplot2 Integration

Convert existing ggplot2 visualizations to animations:

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()

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.

Citation

If you use manimR in your research or teaching, please cite:

citation("manimR")

Acknowledgments

  • Inspired by Grant Sanderson’s manim
  • Built with love for the R community
  • Thanks to all contributors

License

MIT © 2025 manimR Authors