R gganimate package for animated plots. Use for creating animated ggplot2 visualizations.
Scanned 9/8/2026
Install to Claude Code
npx -y skills add LeoLin990405/r-analytics-skill --skill gganimate --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Gganimate?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/leolin990405-gganimate-r-analytics-skill)More formats (shields.io, HTML) on the badges page.
---
name: gganimate
description: R gganimate package for animated plots. Use for creating animated ggplot2 visualizations.
---
# gganimate
A grammar of animated graphics.
## Basic Animation
```r
library(ggplot2)
library(gganimate)
p <- ggplot(gapminder::gapminder, aes(gdpPercap, lifeExp, size = pop, color = continent)) +
geom_point(alpha = 0.7) +
scale_x_log10() +
labs(title = 'Year: {frame_time}') +
transition_time(year) +
ease_aes('linear')
animate(p)
```
## Transitions
```r
# Transition through states
ggplot(data, aes(x, y)) +
geom_point() +
transition_states(state, transition_length = 2, state_length = 1)
# Transition along time
ggplot(data, aes(x, y)) +
geom_point() +
transition_time(time)
# Reveal data
ggplot(data, aes(x, y)) +
geom_line() +
transition_reveal(time)
# Filter data
ggplot(data, aes(x, y)) +
geom_point() +
transition_filter(filter1, filter2)
```
## Labels
```r
# Dynamic labels
labs(title = 'Year: {frame_time}')
labs(title = 'State: {closest_state}')
labs(title = '{current_frame} of {nframes}')
```
## Enter/Exit
```r
ggplot(data, aes(x, y)) +
geom_point() +
transition_states(state) +
enter_fade() +
exit_shrink()
# Options: enter_fade, enter_grow, enter_appear
# exit_fade, exit_shrink, exit_disappear
```
## Shadow
```r
# Leave trail
ggplot(data, aes(x, y)) +
geom_point() +
transition_time(time) +
shadow_wake(wake_length = 0.1)
# Mark previous positions
ggplot(data, aes(x, y)) +
geom_point() +
transition_time(time) +
shadow_mark(past = TRUE, future = FALSE)
```
## Easing
```r
# Easing functions
ease_aes('linear')
ease_aes('quadratic-in')
ease_aes('cubic-in-out')
ease_aes('bounce-out')
ease_aes('elastic-in')
```
## Rendering
```r
# Animate and save
anim <- animate(p, nframes = 100, fps = 10)
anim_save("animation.gif", anim)
# Different renderers
animate(p, renderer = gifski_renderer())
animate(p, renderer = av_renderer()) # Video
animate(p, renderer = ffmpeg_renderer())
```
## View
```r
# Follow data
ggplot(data, aes(x, y)) +
geom_point() +
transition_time(time) +
view_follow()
# Step view
view_step(pause_length = 2, step_length = 1)
```
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!