Mathematical animation engine for R.
Create stunning programmatic animations,
videos, and visualizations — in pure R.
install.packages("manimR")
library(manimR)
scene <- Scene$new(bg = "#050510")
# Fourier decomposition
f <- FourierSeries(
harmonics = 8,
color = "#a855f7"
)
scene$play(DrawCircles(f))
scene$play(Trace(f, color = "#06b6d4"))
scene$render("fourier.mp4")
Expressive, composable, and fast — manimR brings the power of programmatic animation to the R ecosystem.
Compose animations frame-by-frame using a clean, functional scene API. Chain transforms, play multiple objects simultaneously, and control timing with easing functions — all from R.
scene$play(Create(circle), run_time = 2)
scene$play(Rotate(circle, PI), FadeIn(label))
Circles, polygons, arrows, Bézier curves, LaTeX labels, number lines, coordinate axes, graphs, and 3D surfaces — all animatable.
Hardware-accelerated via Cairo and FFmpeg. Produce broadcast-quality MP4 at 60fps or optimized GIFs without leaving R.
Write equations using standard LaTeX syntax and animate them — transform, morph, or highlight individual terms.
Built-in easing curves — linear, ease-in-out, spring, bounce — with per-object and per-scene timing control.
Render three-dimensional mathematical objects — surfaces, vector fields, parametric curves — with full camera orbit, zoom, and lighting control. Powered by an OpenGL-compatible backend.
scene3d <- Scene3D$new()
surf <- Surface(z ~ sin(x) * cos(y))
scene3d$play(OrbitCamera(surf, angle = TAU))
Get manimR from CRAN or install the development version directly from GitHub.
# From CRAN
install.packages("manimR")
# Dev version
remotes::install_github(
"Reyanda/manimR"
)
Create a scene, add objects, and describe animations using the fluent R API.
library(manimR)
scene <- Scene$new()
sq <- Square(
side = 2,
color = "#6366f1"
)
scene$play(
Create(sq),
Rotate(sq, PI / 4),
FadeOut(sq)
)
Call render() and choose your output format — MP4, GIF, or transparent WebM.
# Render at 60fps, 1080p
scene$render(
output = "my_anim.mp4",
fps = 60,
width = 1920,
height = 1080
)
# → Output: my_anim.mp4 ✓
A taste of what's possible — from proof visualizations to data storytelling.
Visualizing harmonic components of a periodic signal
Animated sine / cosine visualization
Rotating polygon transforms
Animated statistical charts
Full API reference, tutorials from first animation to advanced 3D scenes, and a cookbook of ready-made examples — all on GitHub.